summaryrefslogtreecommitdiff
path: root/lisp/imenu.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2013-02-01 00:23:47 -0800
committerGlenn Morris <rgm@gnu.org>2013-02-01 00:23:47 -0800
commit48c828b923a1c8f0b3350be96fcc9ec8a7c21dbc (patch)
treef3db1b662699e18d68d80f4a26fc75a066819d26 /lisp/imenu.el
parentcd87ae10a83f64f6afa24d8611f1d10aa3c09086 (diff)
downloademacs-48c828b923a1c8f0b3350be96fcc9ec8a7c21dbc.tar.gz
* imenu.el (imenu-default-create-index-function):
Tweak infinite loop test to check for forward motion as well as none.
Diffstat (limited to 'lisp/imenu.el')
-rw-r--r--lisp/imenu.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/imenu.el b/lisp/imenu.el
index 80fc441c896..c1077a49d1a 100644
--- a/lisp/imenu.el
+++ b/lisp/imenu.el
@@ -676,12 +676,12 @@ The alternate method, which is the one most often used, is to call
;; in these major modes. But save that change for later.
(cond ((and imenu-prev-index-position-function
imenu-extract-index-name-function)
- (let ((index-alist '()) (pos -1)
+ (let ((index-alist '()) (pos (point-max))
name)
- (goto-char (point-max))
+ (goto-char pos)
;; Search for the function
(while (funcall imenu-prev-index-position-function)
- (when (= pos (point))
+ (unless (< (point) pos)
(error "Infinite loop at %s:%d: imenu-prev-index-position-function does not move point" (buffer-name) pos))
(setq pos (point))
(save-excursion