From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#41809: c-context-line-break incorrect after comments: cache issue? Date: 11 Jun 2020 18:38:29 -0000 Organization: muc.de e.V. Message-ID: <20200611183829.59331.qmail@mail.muc.de> References: <0bc193e74adca0ff2fea88aae374330b.squirrel@dancol.org> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="55686"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: tin/2.4.4-20191224 ("Millburn") (FreeBSD/11.3-RELEASE-p9 (amd64)) Cc: 41809@debbugs.gnu.org, acm@muc.de To: "Daniel Colascione" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 11 20:39:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jjS6Y-000EPA-Dx for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Jun 2020 20:39:10 +0200 Original-Received: from localhost ([::1]:52024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jjS6X-0002dq-DA for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Jun 2020 14:39:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44834) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jjS6Q-0002di-KU for bug-gnu-emacs@gnu.org; Thu, 11 Jun 2020 14:39:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54704) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jjS6Q-0002qa-AX for bug-gnu-emacs@gnu.org; Thu, 11 Jun 2020 14:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jjS6Q-0004Si-8J for bug-gnu-emacs@gnu.org; Thu, 11 Jun 2020 14:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Jun 2020 18:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41809 X-GNU-PR-Package: emacs Original-Received: via spool by 41809-submit@debbugs.gnu.org id=B41809.159190071917123 (code B ref 41809); Thu, 11 Jun 2020 18:39:02 +0000 Original-Received: (at 41809) by debbugs.gnu.org; 11 Jun 2020 18:38:39 +0000 Original-Received: from localhost ([127.0.0.1]:38017 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jjS62-0004S7-Tn for submit@debbugs.gnu.org; Thu, 11 Jun 2020 14:38:39 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:52810 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1jjS60-0004Rp-Jb for 41809@debbugs.gnu.org; Thu, 11 Jun 2020 14:38:37 -0400 Original-Received: (qmail 59332 invoked by uid 3782); 11 Jun 2020 18:38:29 -0000 In-Reply-To: X-Newsgroups: gnu.emacs.bug X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:181866 Archived-At: Hello, Daniel. In article 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).