all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Christopher J. Madsen" <cjm@cjmweb.net>
Cc: 385@emacsbugs.donarmstrong.com, bug-gnu-emacs@gnu.org
Subject: bug#385: [PATCH] comment-indent doesn't respect comment-indent-function
Date: Wed, 11 Jun 2008 14:04:57 -0400	[thread overview]
Message-ID: <jwv1w33vosi.fsf-monnier+emacsbugreports@gnu.org> (raw)
In-Reply-To: <20080611171102.7261.qmail@byte.local> (Christopher J. Madsen's message of "11 Jun 2008 17:11:02 -0000")

> 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







  reply	other threads:[~2008-06-11 18:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-11 17:11 bug#385: [PATCH] comment-indent doesn't respect comment-indent-function Christopher J. Madsen
2008-06-11 18:04 ` Stefan Monnier [this message]
2008-06-11 18:59   ` Christopher J. Madsen
2008-06-13 16:47     ` bug#385: [PATCH] comment-indent doesn't respect Stefan Monnier
2017-06-14  4:33   ` bug#385: [PATCH] comment-indent doesn't respect comment-indent-function npostavs
2017-07-06  2:58     ` npostavs
2016-02-29  4:59 ` Lars Ingebrigtsen
2016-03-03  5:03   ` Christopher J. Madsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv1w33vosi.fsf-monnier+emacsbugreports@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=385@emacsbugs.donarmstrong.com \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=cjm@cjmweb.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.