mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
(imenu--in-alist): Accept only bottom-level matches.
This commit is contained in:
parent
e932d73def
commit
8396299d26
1 changed files with 11 additions and 5 deletions
|
|
@ -493,11 +493,17 @@ This function is called after the function pointed out by
|
|||
tail (cdr elt)
|
||||
alist (cdr alist)
|
||||
head (car elt))
|
||||
(if (string= str head)
|
||||
(setq alist nil res elt)
|
||||
(if (and (listp tail)
|
||||
(setq res (imenu--in-alist str tail)))
|
||||
(setq alist nil))))
|
||||
;; A nested ALIST element looks like
|
||||
;; (INDEX-NAME (INDEX-NAME . INDEX-POSITION) ...)
|
||||
;; while a bottom-level element looks like
|
||||
;; (INDEX-NAME . INDEX-POSITION)
|
||||
;; We are only interested in the bottom-level elements, so we need to
|
||||
;; recurse if TAIL is a list.
|
||||
(cond ((listp tail)
|
||||
(if (setq res (imenu--in-alist str tail))
|
||||
(setq alist nil)))
|
||||
((string= str head)
|
||||
(setq alist nil res elt))))
|
||||
res))
|
||||
|
||||
(defun imenu-default-create-index-function ()
|
||||
|
|
|
|||
Loading…
Reference in a new issue