From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.devel Subject: Re: C++ name and add-log-current-defun Date: Thu, 21 Sep 2006 09:05:39 -0600 Organization: IHS Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1158852059 24424 80.91.229.2 (21 Sep 2006 15:20:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 21 Sep 2006 15:20:59 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 21 17:20:58 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GQQH1-0006lQ-Ii for ged-emacs-devel@m.gmane.org; Thu, 21 Sep 2006 17:15:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GQQH0-00037Z-Q1 for ged-emacs-devel@m.gmane.org; Thu, 21 Sep 2006 11:15:34 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GQQGo-00036k-Up for emacs-devel@gnu.org; Thu, 21 Sep 2006 11:15:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GQQGn-00033O-Ib for emacs-devel@gnu.org; Thu, 21 Sep 2006 11:15:22 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GQQGn-00032u-Am for emacs-devel@gnu.org; Thu, 21 Sep 2006 11:15:21 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GQQKK-0008Jt-Fo for emacs-devel@gnu.org; Thu, 21 Sep 2006 11:19:00 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1GQQBI-00056r-J2 for emacs-devel@gnu.org; Thu, 21 Sep 2006 17:09:40 +0200 Original-Received: from 207.167.42.206 ([207.167.42.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 21 Sep 2006 17:09:40 +0200 Original-Received: from ihs_4664 by 207.167.42.206 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 21 Sep 2006 17:09:40 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 43 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.206 User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) In-Reply-To: X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:60068 Archived-At: Herbert Euler wrote: > add-log-current-defun cannot handle C++ names well. For > example, the current function: > > int some_class::some_method(int arg) > { > // ... > } > > If one invoke add-change-log-entry-other-window when point > is in this function, one would get > > * some_file.cpp (class::some_method): > > rather than > > * some_file.cpp (some_class::some_method): > > This is because add-log-current-defun in add-log.el calculates > the function name wrong. Below is the code: > > ;; Now find the right beginning of the name. > ;; Include certain keywords if they > ;; precede the name. > (setq middle (point)) > (forward-word -1) > ;; Is this C++ method? > ;; ... > > (forward-word -1) wouldn't put point before `some_class', > but puts point before `c' in `some_class'. > > How about changing it to like this? > > (while (not (looking-back "\\(^\\|[ \t]\\)")) > (backward-word 1)) How about making the intent clear: (skip-syntax-backward "w_") ; word and symbol characters -- Kevin