of overlays in imenu--index-alist.
+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.
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
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