GNU bug report logs - #385
[PATCH] comment-indent doesn't respect comment-indent-function

Previous Next

Package: emacs;

Reported by: "Christopher J. Madsen" <cjm <at> cjmweb.net>

Date: Wed, 11 Jun 2008 17:20:04 UTC

Severity: minor

Tags: fixed, patch

Fixed in version 26.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


Message #10 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "Christopher J. Madsen" <cjm <at> cjmweb.net>
Cc: 385 <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
Subject: Re: bug#385: [PATCH] comment-indent doesn't respect comment-indent-function
Date: Wed, 11 Jun 2008 14:04:57 -0400
> It appears that comment-indent changed in 22.1.  It gained some code

Indeed, and it changed further in 22.2.

> to attempt to align the comment with those on surrounding lines.
> Unfortunately, this made it impossible to do certain things with
> comment-indent-function.

> For example, I had a custom indent function that placed comments
> immediately after a closing brace.  However, in Emacs 22, I'd see this:

>   while (1) {
>     while (2) {

>     } # end 2 <-- this comment placed correctly
>   }   # end 1 <-- this comment was aligned with the previous one

> instead of this:

>   while (1) {
>     while (2) {

>     } # end 2
>   } # end 1 <-- here's where comment-indent-function placed it

I'm not sure I understand.  Are you saying that you don't want comments
to be aligned in that case?

If you need more control over the placement, rather than a variable
comment-indent-fixed, maybe we should just say that if
comment-indent-function returns a list of a single integer, it should be
taken as the indentation position and not second-guessed.  Or it could
return a cons cell (MIN . MAX) to say "anywhere between MIN and MAX".


        Stefan





This bug report was last modified 7 years and 323 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.