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: Re: C++ name and add-log-current-defun Date: Sat, 23 Dec 2006 11:27:03 +0800 Message-ID: References: NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: sea.gmane.org 1166844447 19846 80.91.229.10 (23 Dec 2006 03:27:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 23 Dec 2006 03:27:27 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 23 04:27:24 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1GxxXf-0001dt-82 for ged-emacs-devel@m.gmane.org; Sat, 23 Dec 2006 04:27:23 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GxxXe-0006RG-Oa for ged-emacs-devel@m.gmane.org; Fri, 22 Dec 2006 22:27:22 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GxxXS-0006OJ-DE for emacs-devel@gnu.org; Fri, 22 Dec 2006 22:27:10 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GxxXQ-0006Mu-Rd for emacs-devel@gnu.org; Fri, 22 Dec 2006 22:27:10 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GxxXQ-0006MX-K8 for emacs-devel@gnu.org; Fri, 22 Dec 2006 22:27:08 -0500 Original-Received: from [65.54.246.220] (helo=bay0-omc3-s20.bay0.hotmail.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GxxXQ-0007lh-91 for emacs-devel@gnu.org; Fri, 22 Dec 2006 22:27:08 -0500 Original-Received: from hotmail.com ([64.4.26.18]) by bay0-omc3-s20.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Fri, 22 Dec 2006 19:27:07 -0800 Original-Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 22 Dec 2006 19:27:07 -0800 Original-Received: from 64.4.26.200 by by112fd.bay112.hotmail.msn.com with HTTP; Sat, 23 Dec 2006 03:27:03 GMT X-Originating-IP: [221.220.245.175] X-Originating-Email: [herberteuler@hotmail.com] X-Sender: herberteuler@hotmail.com In-Reply-To: Original-To: ihs_4664@yahoo.com, emacs-devel@gnu.org X-OriginalArrivalTime: 23 Dec 2006 03:27:07.0461 (UTC) FILETIME=[39504F50:01C72642] 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:64151 Archived-At: Hmmm, I think the choice of ``skip-syntax-backward'' or ``forward-sexp'' is not more important than adding a ``while'' form; both the two functions work, but without a ``while'' form, there is a bug. Regards, Guanpeng Xu >From: Kevin Rodgers >To: emacs-devel@gnu.org >Subject: Re: C++ name and add-log-current-defun >Date: Fri, 22 Dec 2006 13:50:53 -0700 > >Herbert Euler wrote: >>I found this not complete yet, since only going back one sexp >>sometimes cannot reach the beginning of a name. Please take >>``class_1::sub_class_2::method'' as an example. A complete >>solution could be >> >>*** add-log.el.~1.146.2.22.~ Mon Nov 13 10:58:16 2006 >>--- add-log.el Wed Dec 20 10:13:47 2006 >>*************** (defun add-log-current-defun () >>*** 916,922 **** >> ;; Include certain keywords if they >> ;; precede the name. >> (setq middle (point)) >>! (forward-sexp -1) >> ;; Is this C++ method? >> (when (and (< 2 middle) >> (string= (buffer-substring (- >>middle 2) >>--- 916,923 ---- >> ;; Include certain keywords if they >> ;; precede the name. >> (setq middle (point)) >>! (while (not (looking-back "\\(^\\| >>\\|\t\\)")) >>! (forward-sexp -1)) >> ;; Is this C++ method? >> (when (and (< 2 middle) >> (string= (buffer-substring (- >>middle 2) > >Once again, I propose: > >(skip-syntax-backward "w_") ; word and symbol characters > >-- >Kevin > > > >_______________________________________________ >Emacs-devel mailing list >Emacs-devel@gnu.org >http://lists.gnu.org/mailman/listinfo/emacs-devel _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/