diff options
author | Glenn Morris <rgm@gnu.org> | 2013-02-01 00:23:47 -0800 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2013-02-01 00:23:47 -0800 |
commit | 48c828b923a1c8f0b3350be96fcc9ec8a7c21dbc (patch) | |
tree | f3db1b662699e18d68d80f4a26fc75a066819d26 /lisp/imenu.el | |
parent | cd87ae10a83f64f6afa24d8611f1d10aa3c09086 (diff) | |
download | emacs-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.el | 6 |
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 |