all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Emacs-Devel devel'" <emacs-devel@gnu.org>
Subject: how to get M-; pre-Emacs 22 behavior
Date: Tue, 21 Dec 2010 16:17:16 -0800	[thread overview]
Message-ID: <86A046B07BB24913BC5C4B6B242633EE@us.oracle.com> (raw)

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)
    (yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy)
  (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	other threads:[~2010-12-22  0:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-22  0:17 Drew Adams [this message]
2010-12-22 22:56 ` how to get M-; pre-Emacs 22 behavior Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86A046B07BB24913BC5C4B6B242633EE@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.