[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to get M-; pre-Emacs 22 behavior

From: Drew Adams
Subject: how to get M-; pre-Emacs 22 behavior
Date: Tue, 21 Dec 2010 16:17:16 -0800

Is there a simple way to tell Emacs to use the `M-;' indenting that was
available before Emacs 22?  This is what it does now (22+):

(if (xxxxxxxxxxxxxxxxx)
    (yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy) ; Y's comment
  (zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz))       ; Z's comment

(if (xxxxxxxxxxxxxxxxx)
  (zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz))  ; Z's comment

Prior to Emacs 22 both Z comments had the same indentation: the indentation of
the second example.

I prefer that.  To me, there is little reason to align a comment for one `if'
branch with a comment for the other branch (no more reason than aligning the
sexps for the two branches).

Is there some option today that gives the pre-22 behavior?

Note that the older `M-;' indenting still did align comments generally, but not
in the case of `if' branches.  E.g., this example from (elisp) `Comment Tips' is
very old, and in Emacs 20 the same alignment was used:

(setq base-version-list                 ; there was a base
      (assoc (substring fn 0 start-vn)  ; version to which
             file-version-assoc-list))  ; this looks like
                                        ; a subversion

Such alignment can be good esp. for comments like the one shown, which
(logically) extend over several lines.  It does not make much sense (IMHO) for
the different branches of an `if'.  I prefer this:

(if (xxxxxxxxxxxxxxxxx)
    (yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy) ; Y's comment
  (zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz) ; Z's comment which is
  (zzzzzzzzzzz))                      ; long and so continues

With the 22+ indenting, which code is targeted by comment lines is less clear,
IMO.  With everything aligned it's harder to see where one comment ends and
another begins.

Simple option choice somewhere?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]