Commit d1804b71 authored by Karl Heuer's avatar Karl Heuer
Browse files

(which-function): Handle case when (car imenu--index-alist) is nil.

parent dad8ca4c
......@@ -204,8 +204,9 @@ is located before first function, returns nil."
(let ((pair (car-safe imenu--index-alist))
(rest (cdr-safe imenu--index-alist))
(name nil))
(while (and pair (or (not (number-or-marker-p (cdr pair)))
(> (point) (cdr pair))))
(while (and (or rest pair)
(or (not (number-or-marker-p (cdr pair)))
(> (point) (cdr pair))))
(setq name (car pair))
(setq pair (car-safe rest))
(setq rest (cdr-safe rest)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment