all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Rolf Ade <rolf@pointsman.de>
Cc: 23775@debbugs.gnu.org
Subject: bug#23775: bug#23818: 25.0.95.3: c-beginning-of-defun misbehaviour
Date: Wed, 29 Jun 2016 20:26:22 +0000	[thread overview]
Message-ID: <20160629202622.GB5327@acm.fritz.box> (raw)
In-Reply-To: <577306B3.5030501@pointsman.de>

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).





  reply	other threads:[~2016-06-29 20:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22  0:19 bug#23818: 25.0.95.3: c-beginning-of-defun misbehaviour Rolf Ade
     [not found] ` <mailman.1962.1466554808.1216.bug-gnu-emacs@gnu.org>
2016-06-22  8:54   ` Alan Mackenzie
2016-06-22 15:14     ` Eli Zaretskii
2016-06-24 15:02   ` Alan Mackenzie
2016-06-28 23:22     ` bug#23775: " Rolf Ade
2016-06-29 20:26       ` Alan Mackenzie [this message]
2016-06-29 20:27       ` Alan Mackenzie
2016-06-29  0:57     ` Rolf Ade
2017-08-08 21:42       ` Rolf Ade
2017-08-13 13:17         ` Alan Mackenzie
     [not found] ` <mailman.2009.1466608581.1216.bug-gnu-emacs@gnu.org>
2016-06-24 14:43   ` Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160629202622.GB5327@acm.fritz.box \
    --to=acm@muc.de \
    --cc=23775@debbugs.gnu.org \
    --cc=rolf@pointsman.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.