unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* 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

* Re: Patch to make which-function-mode work better with CEDET/Semantic
  2013-01-07  2:58 Patch to make which-function-mode work better with CEDET/Semantic finalpatch
@ 2013-01-10 15:36 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2013-01-10 15:36 UTC (permalink / raw)
  To: finalpatch; +Cc: 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.

Thank you, installed,


        Stefan



^ permalink raw reply	[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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).