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: Thu, 25 Jun 2020 17:12:29 +0000 Message-ID: <20200625171229.GB10342@ACM> References: <20200611183829.59331.qmail@mail.muc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="61041"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, 41809-done@debbugs.gnu.org To: Daniel Colascione Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 25 19:13:11 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 1joVR1-000FmM-6T for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 25 Jun 2020 19:13:11 +0200 Original-Received: from localhost ([::1]:36046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joVR0-0006cJ-2l for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 25 Jun 2020 13:13:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joVQs-0006c0-WB for bug-gnu-emacs@gnu.org; Thu, 25 Jun 2020 13:13:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57717) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1joVQs-0005tg-NM for bug-gnu-emacs@gnu.org; Thu, 25 Jun 2020 13:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1joVQs-0004UE-IH for bug-gnu-emacs@gnu.org; Thu, 25 Jun 2020 13:13:02 -0400 Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Jun 2020 17:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 41809 X-GNU-PR-Package: emacs Mail-Followup-To: 41809@debbugs.gnu.org, acm@muc.de, dancol@dancol.org Original-Received: via spool by 41809-done@debbugs.gnu.org id=D41809.159310515817212 (code D ref 41809); Thu, 25 Jun 2020 17:13:02 +0000 Original-Received: (at 41809-done) by debbugs.gnu.org; 25 Jun 2020 17:12:38 +0000 Original-Received: from localhost ([127.0.0.1]:41030 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1joVQU-0004TX-IH for submit@debbugs.gnu.org; Thu, 25 Jun 2020 13:12:38 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:33825 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1joVQS-0004TD-Lp for 41809-done@debbugs.gnu.org; Thu, 25 Jun 2020 13:12:37 -0400 Original-Received: (qmail 83845 invoked by uid 3782); 25 Jun 2020 17:12:29 -0000 Original-Received: from acm.muc.de (p4fe15761.dip0.t-ipconnect.de [79.225.87.97]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Thu, 25 Jun 2020 19:12:29 +0200 Original-Received: (qmail 11124 invoked by uid 1000); 25 Jun 2020 17:12:29 -0000 Content-Disposition: inline In-Reply-To: <20200611183829.59331.qmail@mail.muc.de> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de 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:182375 Archived-At: Hello, Daniel. On Thu, Jun 11, 2020 at 18:38:29 -0000, Alan Mackenzie wrote: > 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. It wasn't. I've committed a simple patch for this, and I'm closing the bug. > -- > Alan Mackenzie (Nuremberg, Germany).