From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#23775: bug#23818: 25.0.95.3: c-beginning-of-defun misbehaviour Date: Wed, 29 Jun 2016 20:26:22 +0000 Message-ID: <20160629202622.GB5327@acm.fritz.box> References: <20160624150234.66344.qmail@mail.muc.de> <577306B3.5030501@pointsman.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1467232048 16765 80.91.229.3 (29 Jun 2016 20:27:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Jun 2016 20:27:28 +0000 (UTC) Cc: 23775@debbugs.gnu.org To: Rolf Ade Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 29 22:27:17 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 1bIM4p-00054c-Ro for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Jun 2016 22:27:15 +0200 Original-Received: from localhost ([::1]:45636 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIM4o-0002aQ-Tz for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Jun 2016 16:27:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIM4i-0002a4-3L for bug-gnu-emacs@gnu.org; Wed, 29 Jun 2016 16:27:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bIM4g-0004s0-RR for bug-gnu-emacs@gnu.org; Wed, 29 Jun 2016 16:27:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48019) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIM4b-0004qs-Rw; Wed, 29 Jun 2016 16:27:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bIM4b-0005xd-Ku; Wed, 29 Jun 2016 16:27:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Wed, 29 Jun 2016 20:27:01 +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.146723197722863 (code B ref 23775); Wed, 29 Jun 2016 20:27:01 +0000 Original-Received: (at 23775) by debbugs.gnu.org; 29 Jun 2016 20:26:17 +0000 Original-Received: from localhost ([127.0.0.1]:60356 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bIM3t-0005wg-87 for submit@debbugs.gnu.org; Wed, 29 Jun 2016 16:26:17 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:21294) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bIM3r-0005wX-NS for 23775@debbugs.gnu.org; Wed, 29 Jun 2016 16:26:16 -0400 Original-Received: (qmail 7717 invoked by uid 3782); 29 Jun 2016 20:26:14 -0000 Original-Received: from acm.muc.de (p4FC4603C.dip0.t-ipconnect.de [79.196.96.60]) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 29 Jun 2016 22:26:12 +0200 Original-Received: (qmail 21195 invoked by uid 1000); 29 Jun 2016 20:26:22 -0000 Content-Disposition: inline In-Reply-To: <577306B3.5030501@pointsman.de> User-Agent: Mutt/1.5.24 (2015-08-30) 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-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:120218 Archived-At: Hello, Rolf. On Wed, Jun 29, 2016 at 01:22:27AM +0200, Rolf Ade wrote: > Hello Alan, > sorry for replying late, was off road. No problems. > 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. Thank you. > 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. Whoops! It needed revisiting 7½ years ago, but better late than never! I've committed the changes, to the CC Mode repository, the Emacs master branch and the XEmacs package repository. I'm going to close the bug. -- Alan Mackenzie (Nuremberg, Germany).