From d1804b71b65227f00bc2729fa2f3b30c0e2ba066 Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Wed, 30 Sep 1998 19:02:23 +0000 Subject: (which-function): Handle case when (car imenu--index-alist) is nil. --- lisp/which-func.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lisp/which-func.el') 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))) -- cgit v1.2.1