[Top][All Lists]

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

Re: bad comment indentation in Emacs Lisp

From: Stefan Monnier
Subject: Re: bad comment indentation in Emacs Lisp
Date: Sun, 10 Feb 2008 14:42:17 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

> The principle he cites is correct -- could you please fix this
> and ack?

I don't see in what way the behavior doesn't follow the principle proposed.

> Put this in Emacs Lisp mode and use `C-M-q' at the beginning:
> (let (;; foobar
>       ;; toto
>       (titi...)))
> You get this:
> (let ( ;; foobar
>       ;; toto
>       (titi...)))
> However, if you just use TAB on each line, you don't get that.

Right, because indent-region does both TAB and M-; on each line (more
or less).
> To me, this is a bug.  `;;' comments should be aligned just as
> TAB would align them, always.

TAB generally doesn't touch the comments unless the line itself starts
with a comment.

> `C-M-q' should be equivalent to using both TAB and `M-;' on each line
> of the sexp.

That's indeed what it does.

> Also, in a situation like the preceding, it is likely that you
> want the two comments to line up.

It's possible, but not sure.  Use a single ";" to get comments aligned.
And use ";;" but put each comment-line on its own line.  This way,
there won't be any ambiguity and they'll be aligned.


reply via email to

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