unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* M-; : comment-column gets overridden by fill-column. Is this the Right Thing?
@ 2010-05-22 15:17 Alan Mackenzie
  2010-05-23  1:15 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Mackenzie @ 2010-05-22 15:17 UTC (permalink / raw)
  To: emacs-devel

Hi, Emacs,

In a recent request for help from Michael Massmann on gnu.emacs.help,
he wants comments to be at column 100, but was unable to make M-; do
this.

He'd set comment column to 100, and had tried playing around with the
comment configuration in CC Mode, all to no avail.

M-; invokes comment-dwim calls comment-indent, which starts by putting
an empty comment at col 100.  It's not finished, though.

comment-indent then calls comment-choose-indent, which returns 72.
comment-indent then repositions the empty comment to col 72.  :-(

comment-choose-indent (which might better be called
comment-chews-indent ;-) makes the comment fit inside fill-column,
despite the fact that auto-fill-mode isn't enabled.  This is surely not
the right thing.  Should c-c-indent use fill-column when auto-fill-mode
is enabled?

Surely the documentation for M-; should mention fill-column?

Why is this comment stuff in such a mess?

-- 
Alan Mackenzie (Nuremberg, Germany).



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: M-; : comment-column gets overridden by fill-column. Is this the Right Thing?
  2010-05-22 15:17 M-; : comment-column gets overridden by fill-column. Is this the Right Thing? Alan Mackenzie
@ 2010-05-23  1:15 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2010-05-23  1:15 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: emacs-devel

> comment-choose-indent (which might better be called
> comment-chews-indent ;-) makes the comment fit inside fill-column,
> despite the fact that auto-fill-mode isn't enabled.  This is surely not
> the right thing.  Should c-c-indent use fill-column when auto-fill-mode
> is enabled?

We can do two things:
- ignore fill-column if it's smaller than comment-column.
  That's a pretty "obviously safe" choice which would solve the problem
  of the OP.
- only obey fill-column if auto-fill-mode is enabled.

The second choice is an incompatible change and would force me to enable
auto-fill-mode in my programming modes (and then set
comment-auto-fill-only-comments to avoid the annoying "fill code"
behavior), but it seems reasonable.

> Surely the documentation for M-; should mention fill-column?

As long as it doesn't mention comment-column, I don't see why it should
mention fill-column.

> Why is this comment stuff in such a mess?

What mess?


        Stefan



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-05-23  1:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-22 15:17 M-; : comment-column gets overridden by fill-column. Is this the Right Thing? Alan Mackenzie
2010-05-23  1:15 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).