First let me show a few things that work correctly. I am doing everything shown below using emacs -q foo.txt
in a text buffer.
I make these settings first:
(setq comment-start "<<")
(setq comment-end ">>")
(setq comment-style 'box)
(setq comment-column 25)
I have this text buffer:
The quick brown fox
jumps over
the lazy dog
If I select the three lines with C-SPC C-n C-n C-n
and press M-;
. The buffer becomes like this:
<<<<<<<<<<<<<<<<<<<<<<<>>
<< The quick brown fox >>
<< jumps over >>
<< the lazy dog >>
<<<<<<<<<<<<<<<<<<<<<<<>>
All good. This is what I expected. Now I undo the change and revert the text to original state.
But now I change the comment style to:
(setq comment-style 'aligned)
Then I select the three lines of text again and press M-;
. I get this:
<< The quick brown fox >>
<< jumps over >>
<< the lazy dog >>
The comment ends are not aligned. I was expecting this:
<< The quick brown fox >>
<< jumps over >>
<< the lazy dog >>
Is comment-style
'aligned
supposed to align the comment ends or not? If not what is 'aligned
supposed to do?
The value of comment-styles
on my Emacs:
((plain nil nil nil nil "Start in column 0 (do not indent), as in Emacs-20")
(indent-or-triple nil nil nil multi-char "Start in column 0, but only for single-char starters")
(indent nil nil nil t "Full comment per line, ends not aligned")
(aligned nil t nil t "Full comment per line, ends aligned")
(box nil t t t "Full comment per line, ends aligned, + top and bottom")
(extra-line t nil t t "One comment for all lines, end on a line by itself")
(multi-line t nil nil t "One comment for all lines, end on last commented line")
(box-multi t t t t "One comment for all lines, + top and bottom"))
C-h v comment-styles
), your expectation is correct. Please add the value of the variablecomment-styles
to your post.comment-styles
to the post. What results do you get when you perform the steps in my post withemacs -q foo.txt
? Do you get aligned comment ends?M-x report-emacs-bug
(at least, the related docs could be added / improved), unless someone clarifies the behavior here.