From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: C++ qualified method names Date: Fri, 26 May 2017 10:21:01 +0000 Message-ID: <20170526102101.GB4643@acm.fritz.box> References: <83mva0j6tn.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1495794161 30522 195.159.176.226 (26 May 2017 10:22:41 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 26 May 2017 10:22:41 +0000 (UTC) User-Agent: Mutt/1.5.24 (2015-08-30) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 26 12:22:38 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dECOE-0007rS-2B for ged-emacs-devel@m.gmane.org; Fri, 26 May 2017 12:22:38 +0200 Original-Received: from localhost ([::1]:35909 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dECOJ-0001gC-Lo for ged-emacs-devel@m.gmane.org; Fri, 26 May 2017 06:22:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58633) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dECNe-0001g2-Ty for emacs-devel@gnu.org; Fri, 26 May 2017 06:22:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dECNZ-0000w9-Rt for emacs-devel@gnu.org; Fri, 26 May 2017 06:22:02 -0400 Original-Received: from ocolin.muc.de ([193.149.48.4]:26352 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1dECNZ-0000vo-FH for emacs-devel@gnu.org; Fri, 26 May 2017 06:21:57 -0400 Original-Received: (qmail 18887 invoked by uid 3782); 26 May 2017 10:21:56 -0000 Original-Received: from acm.muc.de (p548C72C9.dip0.t-ipconnect.de [84.140.114.201]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 26 May 2017 12:21:55 +0200 Original-Received: (qmail 5143 invoked by uid 1000); 26 May 2017 10:21:01 -0000 Content-Disposition: inline In-Reply-To: <83mva0j6tn.fsf@gnu.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.4 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:215212 Archived-At: 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).