From 48c828b923a1c8f0b3350be96fcc9ec8a7c21dbc Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 1 Feb 2013 00:23:47 -0800 Subject: [PATCH] * imenu.el (imenu-default-create-index-function): Tweak infinite loop test to check for forward motion as well as none. --- lisp/ChangeLog | 5 +++++ lisp/imenu.el | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) 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 -- 2.39.5