GNU bug report logs - #41809
c-context-line-break incorrect after comments: cache issue?

Previous Next

Package: emacs;

Reported by: "Daniel Colascione" <dancol <at> dancol.org>

Date: Thu, 11 Jun 2020 16:10:02 UTC

Severity: normal

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Daniel Colascione" <dancol <at> dancol.org>
To: 41809 <at> debbugs.gnu.org
Cc: acm <at> muc.de
Subject: bug#41809: c-context-line-break incorrect after comments: cache issue?
Date: Thu, 11 Jun 2020 09:09:17 -0700
c-context-line-break sometimes incorrectly extends a comment when invoked
immediately after the end of a comment. To repro:

emacs -Q --eval '(progn (c-mode) (insert "/*foo*/") (backward-char)
(c-context-line-break) (delete-char -2) (end-of-line)
(c-context-line-break))'

The second c-context-line-break occurs when point is *after* the comment,
so the /*foo*/ comment shouldn't be extended --- yet it is. The problem
appears to be some kind of cc-mode cache corruption. This recipe behaves
correctly:

$ emacs -Q --eval '(progn (c-mode) (insert "/*foo*/") (backward-char)
(c-context-line-break) (delete-char -2) (end-of-line) (c-before-change
(point-min) (point-max)) (c-after-change (point-min) (point-max) (1-
(point-max))) (c-context-line-break))'





This bug report was last modified 4 years and 331 days ago.

Previous Next


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