(add-log-current-defun): Call `forward-sexp'
multiple times to pick a member function name defined as part of nested classes/namespaces.
This commit is contained in:
parent
39d410b58b
commit
3b2452fd1a
2 changed files with 20 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue