]> code.delx.au - gnu-emacs/commitdiff
* lisp/progmodes/which-func.el (which-function): Understand Semantic's use
authorFeng Li <fengli@gmail.com>
Thu, 10 Jan 2013 15:36:01 +0000 (10:36 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 10 Jan 2013 15:36:01 +0000 (10:36 -0500)
of overlays in imenu--index-alist.

lisp/ChangeLog
lisp/imenu.el
lisp/progmodes/which-func.el

index f26c009bf2bc7b058140187654ecd2e6170bea0b..f74abc427af28453b67f7d7177d7ecaa0dd2393f 100644 (file)
@@ -1,3 +1,8 @@
+2013-01-10  Feng Li  <fengli@gmail.com>  (tiny change)
+
+       * progmodes/which-func.el (which-function): Understand Semantic's use
+       of overlays in imenu--index-alist.
+
 2013-01-10  Wolfgang Jenkner  <wjenkner@inode.at>
 
        * man.el: Handle different "man -k" behaviors (bug#13160).  Use utf-8.
index 0bfee770094eb53663ae8da87b7fa321468b5809..f64d1afe951b219d05d737ce585085e48f364a04 100644 (file)
@@ -447,6 +447,8 @@ Don't move point."
 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
index 0279319cc89320319f5ac1acbd81349205712874..adf378f6bc7f1829ed00faa936b49a46aee397e3 100644 (file)
@@ -319,7 +319,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 mark)
+                      (setq mark (overlay-start mark))))
               (when (and (>= (setq offset (- (point) mark)) 0)
                          (< offset minoffset)) ; Find the closest item.
                 (setq minoffset offset