bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#11636: 23.1; wrong comment indentation


From: Jack Duthen
Subject: bug#11636: 23.1; wrong comment indentation
Date: Thu, 7 Jun 2012 11:10:02 +0200

Ok.  Many thanks for the explanation.
I made a mistake. (I'm sorry about that...)
So, I just read carefully the docs to understand what happened.

I didn't know `comment-dwim' (maybe it's new since emacs 14...)
and believed the action of M-; was just to insert or reindent
a comment past the right end of a normal code instruction,
but it seems to do much more.

The documentation of the function `comment-dwim' itself
does not refer to the behaviour of the variable `fill-column',
but it refers to the function `comment-indent',
whose documentation refers to the variable `comment-column',
whose documentation refers to the variable `comment-fill-column',
whose documentation refers to the variable `fill-column'.

So, yes, the documentation describes clearly (sic!)
the behaviour you reminded me in your answer!
(I should have RTFM! and apologize!)

Nevertheless there is no such reference in the Emacs info:
30.5 Manipulating Comments
and its sections (30.5.1 30.5.2 30.5.3):
* Comment Commands::    Inserting, killing, and aligning comments.
* Multi-Line Comments:: Commands for adding and editing multi-line comments.
* Options for Comments::Customizing the comment features.

(though 30.5.2 refers to `auto-fill-mode' (which is not in use
in my example))

Also if you lookup-subject-in-emacs-manual or -in-elisp-manual
with comment-fill-column, you will find no reference to it.

Maybe there should be a word about it in §30.5.1 or §30.5.3 ?


2012/6/6 Stefan Monnier <monnier@iro.umontreal.ca>:
>>     (jd-re-or "COM_writeLog 1")         ;
>>     (jd-re-paren
>>      "return ")                       ; \2 <msg> \n <spaces> "return "
>>     (jd-re-paren "[0-9]"))            ;
>>    "COM_log \\3\\2\\3"))
> [...]
>> Is this a bug?
>
> I don't think so:
> - The second comment is not moved to the same column as the first
>  because that would push the text past fill-column.  If you shorten the
>  second comment or if you increase fill-column, then the 3 comments
>  will be aligned.
> - The first is not moved to the same column as the second because Emacs
>  doesn't look past a non-commented line.  If you add a comment on the
>  `jd-re-paren' line, then Emacs will look further and will align all
>  4 comments.
>
>        Stefan





reply via email to

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