bug-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: Alan Mackenzie
Subject: bug#41809: c-context-line-break incorrect after comments: cache issue?
Date: 11 Jun 2020 18:38:29 -0000
User-agent: tin/2.4.4-20191224 ("Millburn") (FreeBSD/11.3-RELEASE-p9 (amd64))

Hello, Daniel.

In article <mailman.1663.1591891807.2541.bug-gnu-emacs@gnu.org> you wrote:
> 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))'

Thanks for the report.

After a quick bit of edebugging, it seems to be an off-by-one error in
some cache handling.  It shouldn't be too difficult to sort out.

-- 
Alan Mackenzie (Nuremberg, Germany).






reply via email to

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