GNU bug report logs - #16971
24.3.50; comment-beginning behaves differently in current newcomment.el, leads to error in comment-indent-new-line

Previous Next

Package: emacs;

Reported by: Frank Ruben <frankruben27 <at> gmail.com>

Date: Sat, 8 Mar 2014 18:49:03 UTC

Severity: important

Tags: confirmed

Found in version 24.3.50

Fixed in version 24.4

Done: Dmitry Gutov <raaahh <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 16971 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 16971 <at> debbugs.gnu.org, Frank Ruben <frankruben27 <at> gmail.com>
Subject: Re: bug#16971: 24.3.50;
 comment-beginning behaves differently in current newcomment.el, leads
 to error in comment-indent-new-line
Date: Tue, 11 Mar 2014 06:18:41 +0200
>> Anyway in *scratch* buffer, it was like (where '|' marks cursor position):
>>
>> 1) With current newcomment.el (December 2013):
>>
>>     (foo ; bar |baz
>>
>>      M-j =>
>>
>>     (foo ; bar
>>     baz

Apparently, that's because comment-start-skip in emacs-lisp-mode doesn't
match `; ', it needs a preceding character, so it matches e.g. ` ; '.

One fix would be to change it from
"\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *" to
"\\(\\(\\=\\|^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *".

(not sure if there'll be other consequences of this)

Another - revert the revision 114486 and just make `comment-beginning'
use `syntax-ppss' after finding prospective comment starter points with
`comment-search-backward', to check if the state at (match-end 0) is
"inside comment".




This bug report was last modified 11 years and 67 days ago.

Previous Next


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