Tweak infinite loop test to check for forward motion as well as none.
+2013-02-01 Glenn Morris <rgm@gnu.org>
+
+ * imenu.el (imenu-default-create-index-function):
+ Tweak infinite loop test to check for forward motion as well as none.
+
2013-02-01 Alex Harsanyi <AlexHarsanyi@gmail.com>
* net/soap-client.el (soap-invoke): Encode the string for
;; 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