diff options
| author | Karl Heuer | 1998-09-30 19:02:23 +0000 |
|---|---|---|
| committer | Karl Heuer | 1998-09-30 19:02:23 +0000 |
| commit | d1804b71b65227f00bc2729fa2f3b30c0e2ba066 (patch) | |
| tree | b178193546a3a739ba454549e3d16eff51d9c3ae | |
| parent | dad8ca4cc93673ba4dc2761c45f41aebf837192a (diff) | |
| download | emacs-d1804b71b65227f00bc2729fa2f3b30c0e2ba066.tar.gz emacs-d1804b71b65227f00bc2729fa2f3b30c0e2ba066.zip | |
(which-function): Handle case when (car imenu--index-alist) is nil.
| -rw-r--r-- | lisp/which-func.el | 5 |
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." | |||
| 204 | (let ((pair (car-safe imenu--index-alist)) | 204 | (let ((pair (car-safe imenu--index-alist)) |
| 205 | (rest (cdr-safe imenu--index-alist)) | 205 | (rest (cdr-safe imenu--index-alist)) |
| 206 | (name nil)) | 206 | (name nil)) |
| 207 | (while (and pair (or (not (number-or-marker-p (cdr pair))) | 207 | (while (and (or rest pair) |
| 208 | (> (point) (cdr pair)))) | 208 | (or (not (number-or-marker-p (cdr pair))) |
| 209 | (> (point) (cdr pair)))) | ||
| 209 | (setq name (car pair)) | 210 | (setq name (car pair)) |
| 210 | (setq pair (car-safe rest)) | 211 | (setq pair (car-safe rest)) |
| 211 | (setq rest (cdr-safe rest))) | 212 | (setq rest (cdr-safe rest))) |