unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: "Daniel Colascione" <dancol@dancol.org>
Cc: 41809@debbugs.gnu.org, acm@muc.de
Subject: bug#41809: c-context-line-break incorrect after comments: cache issue?
Date: 11 Jun 2020 18:38:29 -0000	[thread overview]
Message-ID: <20200611183829.59331.qmail@mail.muc.de> (raw)
In-Reply-To: <mailman.1663.1591891807.2541.bug-gnu-emacs@gnu.org>

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).






  parent reply	other threads:[~2020-06-11 18:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-11 16:09 bug#41809: c-context-line-break incorrect after comments: cache issue? Daniel Colascione
     [not found] ` <mailman.1663.1591891807.2541.bug-gnu-emacs@gnu.org>
2020-06-11 18:38   ` Alan Mackenzie [this message]
2020-06-12  7:42     ` Alan Mackenzie
2020-06-25 17:12     ` Alan Mackenzie

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=20200611183829.59331.qmail@mail.muc.de \
    --to=acm@muc.de \
    --cc=41809@debbugs.gnu.org \
    --cc=dancol@dancol.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).