[Top][All Lists]

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

Re: autoconf-mode: comment-dwim behaviour

From: Stefan Monnier
Subject: Re: autoconf-mode: comment-dwim behaviour
Date: Tue, 30 Oct 2001 21:39:10 -0500

> Running up "emacs -q -no-site-file configure.in" on an non-existant
> configure.in and pressing M-; twice produces
>       dnl                     dnl 
> whereas I would have hoped that the second M-; would just leave point
> positioned after the first dnl.
> Further M-; presses insert extra spaces after the second dnl, which
> seems unhelpful too.

Indeed, there is a bug in the definition of comment-start-skip
for autoconf-mode.  It sets it to

  (set (make-local-variable 'comment-start-skip) "\\(\\<dnl\\|#\\) +")

which indicates that the beginning of the comment is just after `dnl'
(because it's supposed to be just after the end of the first subgroup).
It can be fixed either by using

  (set (make-local-variable 'comment-start-skip) "\\(\\)\\(\\<dnl\\|#\\) +")

or by using

  (set (make-local-variable 'comment-start-skip) "\\(?:\\<dnl\\|#\\) +")

I will be fixed in the next release of Emacs.  In the mean time, you
can just use

   (add-hook 'autoconf-mode-hook
             (lambda () (setq comment-start-skip "\\(?:\\<dnl\\|#\\) +")))

Thank you for the report,


reply via email to

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