summaryrefslogtreecommitdiff
path: root/lisp/which-func.el
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1998-09-30 19:02:23 +0000
committerKarl Heuer <kwzh@gnu.org>1998-09-30 19:02:23 +0000
commitd1804b71b65227f00bc2729fa2f3b30c0e2ba066 (patch)
treeb178193546a3a739ba454549e3d16eff51d9c3ae /lisp/which-func.el
parentdad8ca4cc93673ba4dc2761c45f41aebf837192a (diff)
downloademacs-d1804b71b65227f00bc2729fa2f3b30c0e2ba066.tar.gz
(which-function): Handle case when (car imenu--index-alist) is nil.
Diffstat (limited to 'lisp/which-func.el')
-rw-r--r--lisp/which-func.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/which-func.el b/lisp/which-func.el
index af9fc74cd82..782882d1be4 100644
--- a/lisp/which-func.el
+++ b/lisp/which-func.el
@@ -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)))