From: Alan Mackenzie <acm@muc.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: C++ qualified method names
Date: Fri, 26 May 2017 10:21:01 +0000 [thread overview]
Message-ID: <20170526102101.GB4643@acm.fritz.box> (raw)
In-Reply-To: <83mva0j6tn.fsf@gnu.org>
Hello, Eli.
On Fri, May 26, 2017 at 12:39:00 +0300, Eli Zaretskii wrote:
> In the C++ method below:
> void
> regcache::raw_supply_integer (int foo)
> {
> whatever (foo);
> }
> invoking "M-: (c-defun-name) RET" produces "raw_supply_integer". Why
> does it exclude the class qualification? Is there a way to have that
> included? This is important e.g. when producing a ChangeLog entry for
> such methods.
Please try the following: it has the disadvantage that it doesn't strip
WS when somebody writes the declaration as "regcache :: \n
raw_supply_integer". But it should work in the vast majority of cases.
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index a5ddcb4b92..9c0798e752 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -1870,7 +1870,7 @@ c-defun-name
(c-backward-token-2)
(c-backward-syntactic-ws))
(setq name-end (point))
- (c-backward-token-2)
+ (c-back-over-compound-identifier)
(buffer-substring-no-properties (point) name-end)))))))))
(defun c-declaration-limits (near)
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2017-05-26 10:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-26 9:39 C++ qualified method names Eli Zaretskii
2017-05-26 10:15 ` Yuri Khan
2017-05-26 12:37 ` Eli Zaretskii
2017-05-26 10:21 ` Alan Mackenzie [this message]
2017-05-26 13:08 ` Eli Zaretskii
2017-05-30 17:10 ` 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=20170526102101.GB4643@acm.fritz.box \
--to=acm@muc.de \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/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).