From: Kevin Rodgers <address@hidden>
To: address@hidden
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
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-devel