* Patch to make which-function-mode work better with CEDET/Semantic
@ 2013-01-07 2:58 finalpatch
2013-01-10 15:36 ` Stefan Monnier
0 siblings, 1 reply; 2+ messages in thread
From: finalpatch @ 2013-01-07 2:58 UTC (permalink / raw)
To: emacs-devel
The Imenu structure generated by Semantic has a slightly different
layout which causes which-function-mode to fall back to the less
accurate add-log-current-defun. This is particularly noticeable when
editing c++ code because add-log-current-defun is often incapable of
parsing c++ methods correctly.
diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el
index 721c610..5e11a56 100644
--- a/lisp/progmodes/which-func.el
+++ b/lisp/progmodes/which-func.el
@@ -314,7 +314,9 @@ If no function name is found, return nil."
namestack (cons (car pair) namestack)
alist (cdr pair)))
- ((number-or-marker-p (setq mark (cdr pair)))
+ ((or (number-or-marker-p (setq mark (cdr pair)))
+ (and (overlayp (cdr pair))
+ (setq mark (overlay-start (cdr pair)))))
(when (and (>= (setq offset (- (point) mark)) 0)
(< offset minoffset)) ; Find the closest item.
(setq minoffset offset
--
Feng Li
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-01-10 15:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-07 2:58 Patch to make which-function-mode work better with CEDET/Semantic finalpatch
2013-01-10 15:36 ` Stefan Monnier
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.