unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Rolf Ade <rolf@pointsman.de>
To: Alan Mackenzie <acm@muc.de>, 23775@debbugs.gnu.org
Subject: bug#23775: bug#23818: 25.0.95.3: c-beginning-of-defun misbehaviour
Date: Wed, 29 Jun 2016 01:22:27 +0200	[thread overview]
Message-ID: <577306B3.5030501@pointsman.de> (raw)
In-Reply-To: <20160624150234.66344.qmail@mail.muc.de>


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.





  reply	other threads:[~2016-06-28 23:22 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.2009.1466608581.1216.bug-gnu-emacs@gnu.org>
2016-06-24 14:43   ` Alan Mackenzie
     [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     ` Rolf Ade [this message]
2016-06-29 20:26       ` bug#23775: " Alan Mackenzie
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

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=577306B3.5030501@pointsman.de \
    --to=rolf@pointsman.de \
    --cc=23775@debbugs.gnu.org \
    --cc=acm@muc.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).