emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ name and add-log-current-defun


From: Kevin Rodgers
Subject: Re: C++ name and add-log-current-defun
Date: Fri, 22 Dec 2006 13:50:53 -0700
User-agent: Thunderbird 1.5.0.8 (Windows/20061025)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]