emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r111474: * lisp/progmodes/which-func.


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111474: * lisp/progmodes/which-func.el (which-function): Understand Semantic's use
Date: Thu, 10 Jan 2013 10:36:01 -0500
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111474
author: Feng Li <address@hidden>
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Thu 2013-01-10 10:36:01 -0500
message:
  * lisp/progmodes/which-func.el (which-function): Understand Semantic's use
  of overlays in imenu--index-alist.
modified:
  lisp/ChangeLog
  lisp/imenu.el
  lisp/progmodes/which-func.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-01-10 15:01:35 +0000
+++ b/lisp/ChangeLog    2013-01-10 15:36:01 +0000
@@ -1,3 +1,8 @@
+2013-01-10  Feng Li  <address@hidden>  (tiny change)
+
+       * progmodes/which-func.el (which-function): Understand Semantic's use
+       of overlays in imenu--index-alist.
+
 2013-01-10  Wolfgang Jenkner  <address@hidden>
 
        * man.el: Handle different "man -k" behaviors (bug#13160).  Use utf-8.

=== modified file 'lisp/imenu.el'
--- a/lisp/imenu.el     2013-01-02 16:13:04 +0000
+++ b/lisp/imenu.el     2013-01-10 15:36:01 +0000
@@ -447,6 +447,8 @@
 Simple elements in the alist look like (INDEX-NAME . POSITION).
 POSITION is the buffer position of the item; to go to the item
 is simply to move point to that position.
+POSITION is passed to `imenu-default-goto-function', so it can be a non-number
+if that variable has been changed (e.g. Semantic uses overlays for POSITIONs).
 
 Special elements look like (INDEX-NAME POSITION FUNCTION ARGUMENTS...).
 To \"go to\" a special element means applying FUNCTION

=== modified file 'lisp/progmodes/which-func.el'
--- a/lisp/progmodes/which-func.el      2013-01-01 09:11:05 +0000
+++ b/lisp/progmodes/which-func.el      2013-01-10 15:36:01 +0000
@@ -319,7 +319,9 @@
                     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 mark)
+                      (setq mark (overlay-start mark))))
               (when (and (>= (setq offset (- (point) mark)) 0)
                          (< offset minoffset)) ; Find the closest item.
                 (setq minoffset offset


reply via email to

[Prev in Thread] Current Thread [Next in Thread]