emacs-devel
[Top][All Lists]
Advanced

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

Re: perl-mode problem in C-x ; comment-set-column


From: Stefan Monnier
Subject: Re: perl-mode problem in C-x ; comment-set-column
Date: Wed, 26 Sep 2007 16:09:36 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux)

> I use the C-x ; runs the command comment-set-column command to format my
> comments in the perl code I write. I have noticed in the last couple of years
> of moving up to emacs-22.0.990 that the consistant operation I observed back
> in 21.3 is gone. I usually put this line at the top of the file

> # -*-mode: Perl; fill-column: 180; comment-column: 101; -*-

> I then do a code macro to search for a # and do <esc>; to set the comments
> position across the entire buffer. Many of the line align properly. Many do
> not. In one file I shortened the comment back to position 60. Someof the
> lines stayed out at 101. I then went in and remove all of the spaces between
> the ; .. # and reexecuted the <esc>; and the comment moved out to 60.

The comment column is now chosen in a more complex manner to try and keep
comments within reasonable columns and to try and align them together.
So basically the rule is now something like:

1 - we first try and make sure that comments to not pass comment-fill-column,
    so long comments may ignore comment-column.
2 - try to align the comment to another comment on the previous line
    (assuming this is possible within the constraints given in (1) as well
    as the constraints imposed by the rest of the text on the line).
3 - if (2) is not applicable use the column closest to comment-column within
    the constraints given in (1).

In the trunk, the rules have been slightly refined as far as number 2 goes,
to try and maximize the number of cases where (2) applies.

So my guess is that you have comments longer than 80 columns, which hence
can't be placed at column 101 because they'd go past fill-column (which is
what comment-fill-column default to).


        Stefan




reply via email to

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