From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Herbert Euler" Newsgroups: gmane.emacs.devel Subject: C++ name and add-log-current-defun Date: Thu, 21 Sep 2006 20:39:37 +0800 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: sea.gmane.org 1158842485 18547 80.91.229.2 (21 Sep 2006 12:41:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 21 Sep 2006 12:41:25 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 21 14:41:17 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 1GQNqU-0002dS-6i for ged-emacs-devel@m.gmane.org; Thu, 21 Sep 2006 14:40:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GQNqT-0005hQ-Ez for ged-emacs-devel@m.gmane.org; Thu, 21 Sep 2006 08:40:01 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GQNqD-0005fD-S4 for emacs-devel@gnu.org; Thu, 21 Sep 2006 08:39:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GQNqB-0005c4-Ui for emacs-devel@gnu.org; Thu, 21 Sep 2006 08:39:45 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GQNqB-0005bi-NW for emacs-devel@gnu.org; Thu, 21 Sep 2006 08:39:43 -0400 Original-Received: from [65.54.246.85] (helo=bay0-omc1-s13.bay0.hotmail.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GQNth-0008H4-Bo for emacs-devel@gnu.org; Thu, 21 Sep 2006 08:43:21 -0400 Original-Received: from hotmail.com ([64.4.26.11]) by bay0-omc1-s13.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 21 Sep 2006 05:39:42 -0700 Original-Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 21 Sep 2006 05:39:41 -0700 Original-Received: from 64.4.26.200 by by112fd.bay112.hotmail.msn.com with HTTP; Thu, 21 Sep 2006 12:39:37 GMT X-Originating-IP: [216.145.54.158] X-Originating-Email: [herberteuler@hotmail.com] X-Sender: herberteuler@hotmail.com Original-To: emacs-devel@gnu.org X-OriginalArrivalTime: 21 Sep 2006 12:39:41.0916 (UTC) FILETIME=[027DE9C0:01C6DD7B] 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:60063 Archived-At: 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)) Regards, Guanpeng Xu _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/