]> git.eshelyaron.com Git - emacs.git/commitdiff
(add-log-current-defun): Call `forward-sexp'
authorMasatake YAMATO <jet@gyve.org>
Tue, 26 Dec 2006 03:53:04 +0000 (03:53 +0000)
committerMasatake YAMATO <jet@gyve.org>
Tue, 26 Dec 2006 03:53:04 +0000 (03:53 +0000)
multiple times to pick a member function name defined as
part of nested classes/namespaces.

lisp/ChangeLog
lisp/add-log.el

index 87a00c260656d694b56750f207432f6011900bd1..6d4d36d3be096f40ab303509ee24238e7fb1519f 100644 (file)
@@ -1,3 +1,9 @@
+2006-12-26  Guanpeng Xu  <herberteuler@hotmail.com> (tiny change)
+
+       * add-log.el (add-log-current-defun): Call `forward-sexp'
+       multiple times to pick a member function name defined as
+       part of nested classes/namespaces.
+
 2006-12-26  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
 
        * emacs-lisp/easymenu.el (easy-menu-change): New arg MAP to indicate
 
        * add-log.el (add-log-current-defun): Use `forward-sexp'
        instead of `forward-word' to pick c++::symbol.
-       Reported by Herbert Euler <herberteuler@hotmail.com>.
+       Reported by Guanpeng Xu <herberteuler@hotmail.com>.
 
 2006-09-22  Kenichi Handa  <handa@m17n.org>
 
index 70345a122e153212ffeaf26286a409d4bf530797..2ecb274b4dee0a8d4ce60c6a85f0e9d449c0a6e5 100644 (file)
@@ -916,7 +916,19 @@ Has a preference of looking backwards."
                               ;; Include certain keywords if they
                               ;; precede the name.
                               (setq middle (point))
-                              (forward-sexp -1)
+                              ;; Single (forward-sexp -1) invocation is
+                              ;; not enough for C++ member function defined 
+                              ;; as part of nested class and/or namespace 
+                              ;; like:
+                              ;;
+                              ;;   void 
+                              ;;   foo::bar::baz::bazz ()
+                              ;;   { ...
+                              ;; 
+                              ;; Here we have to move the point to 
+                              ;; the beginning of foo, not bazz.
+                              (while (not (looking-back "\\(^\\|[ \t]\\)"))
+                                (forward-sexp -1))
                               ;; Is this C++ method?
                               (when (and (< 2 middle)
                                          (string= (buffer-substring (- middle 2)