From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Rolf Ade Newsgroups: gmane.emacs.bugs Subject: bug#23818: 25.0.95.3: c-beginning-of-defun misbehaviour Date: Tue, 08 Aug 2017 23:42:36 +0200 Message-ID: <87d185ag8j.fsf@pointsman.de> References: <20160624150234.66344.qmail@mail.muc.de> <57731CE8.3030704@pointsman.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1502228617 31226 195.159.176.226 (8 Aug 2017 21:43:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 8 Aug 2017 21:43:37 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) To: 23818@debbugs.gnu.org, Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 08 23:43:29 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfCHL-0007ES-5F for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Aug 2017 23:43:07 +0200 Original-Received: from localhost ([::1]:44621 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfCHR-00020T-Cv for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Aug 2017 17:43:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfCHL-0001zv-GY for bug-gnu-emacs@gnu.org; Tue, 08 Aug 2017 17:43:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dfCHK-0006x5-6a for bug-gnu-emacs@gnu.org; Tue, 08 Aug 2017 17:43:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43633) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dfCHG-0006ua-E7; Tue, 08 Aug 2017 17:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dfCHG-0004GD-0c; Tue, 08 Aug 2017 17:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Rolf Ade Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Tue, 08 Aug 2017 21:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23818 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 23818-submit@debbugs.gnu.org id=B23818.150222857016360 (code B ref 23818); Tue, 08 Aug 2017 21:43:01 +0000 Original-Received: (at 23818) by debbugs.gnu.org; 8 Aug 2017 21:42:50 +0000 Original-Received: from localhost ([127.0.0.1]:52314 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfCH4-0004Fn-1H for submit@debbugs.gnu.org; Tue, 08 Aug 2017 17:42:50 -0400 Original-Received: from mxout3.interscholz.de ([85.236.196.238]:49412) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfCH2-0004Fb-DM for 23818@debbugs.gnu.org; Tue, 08 Aug 2017 17:42:49 -0400 Original-Received: from localhost (mxout3 [127.0.0.1]) by mxout3.interscholz.de (Postfix) with ESMTP id 84C8921F0D; Tue, 8 Aug 2017 23:42:40 +0200 (CEST) X-Virus-Scanned: interscholz amavisd-new at mxout3.interscholz.de Original-Received: from server.web01.interscholz.net (server.web01.interscholz.net [85.236.196.138]) by mxout3.interscholz.de (Postfix) with ESMTP id 4EF5920D3F; Tue, 8 Aug 2017 23:42:39 +0200 (CEST) Original-Received: from linux-qg7d (p4FFBE1C9.dip0.t-ipconnect.de [79.251.225.201]) by server.web01.interscholz.net (Postfix) with ESMTPSA id ED52E34032F; Tue, 8 Aug 2017 23:42:36 +0200 (CEST) In-Reply-To: <57731CE8.3030704@pointsman.de> (Rolf Ade's message of "Wed, 29 Jun 2016 02:57:12 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:135580 Archived-At: Hi Alan, while searching for something else I saw it bug is still open. It's fixed and good, but just not closed. (Somehow, the following exchanges about this bug landed in bug#23775.) Clean up and mark as done. rolf Rolf Ade writes: > Hello Alan, > > sorry for replying late, was off road. > > Am 06/24/2016 05:02 PM, Alan Mackenzie wrote: >> [...] >> There are two things here. The first is that you must configure "DBG" as >> a "macro with a semicolon", as detailed in the CC Mode manual, page >> "Macros with ;". For example, you could put the following into your >> c-mode-common-hook: >> >> (setq c-macro-names-with-semicolon '("DBG")) >> (c-make-macro-with-semi-re) >> >> [...] >> The second part of the fix is an actual bug where the software fails to >> check for "macros with semicolons" at a critical point. For that, could >> you install the following patch, please, then byte-compile cc-engine.el: >> >> >> >> diff -r 4c8ccaedfd6a cc-engine.el >> --- a/cc-engine.el Fri Jun 24 13:06:30 2016 +0000 >> +++ b/cc-engine.el Fri Jun 24 14:55:30 2016 +0000 >> @@ -9135,7 +9135,8 @@ >> (/= last-stmt-start (point)) >> (progn >> (c-backward-syntactic-ws lim) >> - (not (memq (char-before) '(?\; ?} ?: nil)))) >> + (not (or (memq (char-before) '(?\; ?} ?: nil)) >> + (c-at-vsemi-p)))) >> (save-excursion >> (backward-char) >> (not (looking-at "\\s("))) >> > > Did so. Patched, byte-compiled, evaluated the configuration in a emacs > -Q: Yes, this works now as expected. With the example file and with > the real case out of the wild > (http://core.tcl.tk/tdom/artifact/2cf83fbbaefad3ef?ln=3268-3362), from > which I stripped my reported example down. Much more pleasant, now. > Thanks. > > > I wasn't aware of chapter 12 "Customizing Macros" of the cc mode > manual, in some sense I obviously expected that to "just work". > > Since I now have looked into chapter 12 of the manual I must say I > also naive expected that to 'just' work ... > > Probably this should all work a completetly other way. As > > emacs -Q > M-: (require 'cc-mode) RET > C-h v c-macro-names-with-semicolon RET > > suggests. The last paragraph reads: > > "Note that currently (2008-11-04) this variable is a prototype, > and is likely to disappear or change its form soon." > > That docstring may need revisiting.