From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rolf Ade Newsgroups: gmane.emacs.bugs Subject: bug#23775: bug#23818: 25.0.95.3: c-beginning-of-defun misbehaviour Date: Wed, 29 Jun 2016 01:22:27 +0200 Message-ID: <577306B3.5030501@pointsman.de> References: <20160624150234.66344.qmail@mail.muc.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1467156213 31083 80.91.229.3 (28 Jun 2016 23:23:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Jun 2016 23:23:33 +0000 (UTC) To: Alan Mackenzie , 23775@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 29 01:23:19 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bI2Le-0002oZ-VH for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Jun 2016 01:23:19 +0200 Original-Received: from localhost ([::1]:40312 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bI2La-0005fo-0M for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Jun 2016 19:23:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43594) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bI2LR-0005fi-Vm for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2016 19:23:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bI2LO-0004xW-NJ for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2016 19:23:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47139) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bI2LO-0004xS-K8; Tue, 28 Jun 2016 19:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bI2LO-0005Va-Ar; Tue, 28 Jun 2016 19:23: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, 28 Jun 2016 23:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23775 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: wontfix Original-Received: via spool by 23775-submit@debbugs.gnu.org id=B23775.146715615621127 (code B ref 23775); Tue, 28 Jun 2016 23:23:02 +0000 Original-Received: (at 23775) by debbugs.gnu.org; 28 Jun 2016 23:22:36 +0000 Original-Received: from localhost ([127.0.0.1]:59476 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bI2Kx-0005Uh-Ta for submit@debbugs.gnu.org; Tue, 28 Jun 2016 19:22:36 -0400 Original-Received: from mxout3.interscholz.de ([85.236.196.238]:34548) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bI2Kv-0005UY-Tk for 23775@debbugs.gnu.org; Tue, 28 Jun 2016 19:22:34 -0400 Original-Received: from localhost (mxout3 [127.0.0.1]) by mxout3.interscholz.de (Postfix) with ESMTP id C388521554; Wed, 29 Jun 2016 01:22:32 +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 E7412201E6; Wed, 29 Jun 2016 01:22:31 +0200 (CEST) Original-Received: from linux-qg7d.site (p4FFBEB86.dip0.t-ipconnect.de [79.251.235.134]) by server.web01.interscholz.net (Postfix) with ESMTPSA id 7AC2C34034C; Wed, 29 Jun 2016 01:22:28 +0200 (CEST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: <20160624150234.66344.qmail@mail.muc.de> 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:120191 Archived-At: 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.