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)