From: Glenn Morris Date: Fri, 1 Feb 2013 08:23:47 +0000 (-0800) Subject: * imenu.el (imenu-default-create-index-function): X-Git-Tag: emacs-24.3.90~173^2~7^2~174 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=48c828b923a1c8f0b3350be96fcc9ec8a7c21dbc;p=emacs.git * imenu.el (imenu-default-create-index-function): Tweak infinite loop test to check for forward motion as well as none. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a05d0fc0347..e2bb42b62a1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-02-01 Glenn Morris + + * 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 * net/soap-client.el (soap-invoke): Encode the string for 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