Paul> Adrian Aichner <adrian(a)xemacs.org> writes:
>> Do we want to make C-u M-x comment-region smarter?
Paul> No! Make indentation smarter. If a comment begins in column
1,
don't
Paul> indent it when reindenting a region. This solves the
problem without
Paul> style-changes or hacks to comment-region.
Paul> Have I overlooked anything?
This, maybe?
(Info-goto-node "(xemacs)Comments")
Adrian
Could you be a little more specific? I don't what you're referring to.
Maybe this?
You can also use `Meta-;' to align an existing comment. If a line
already contains the string that starts comments, `M-;' just moves
point after it and re-indents it to the conventional place.
Exception:
comments starting in column 0 are not moved.
The trouble is, it doesn't work as documented. Here's a sample.
;;; header comment
;; This function is just an example.
;;; Here either two or three semicolons are appropriate.
(defun foo (x)
;;; And now, the first part of the function:
(lambda (foo bar)
(if (foo bar)
'bif
'baz))
;; The following line adds one.
(1+ x)) ; This line adds one.
;; This function is just an example.
;;; Here either two or three semicolons are appropriate.
(defun foo (x)
;;; And now, the first part of the function:
;; The following sexp is commented out using comment-region.
; (lambda (foo bar)
; (if (foo bar)
; 'bif
; 'baz))
;; The following line adds one.
(1+ x)) ; This line adds one.
I get the same indentation using either M-; or C-M-q.
Testing using xemacs -vanilla on
XEmacs 21.2 (beta37) "Pan" (win32) of Sun Dec 03 2000 on PAULKRAUSE
as well as
XEmacs 21.0 "20 minutes to Nikko" (win32) of Fri Mar 26 1999 on
BLACKBIRD
(which I just happen to have lying around)