From: Glenn Morris Date: Wed, 30 Jan 2013 07:46:28 +0000 (-0800) Subject: * imenu.el (imenu-default-create-index-function): X-Git-Tag: emacs-24.2.93~26 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1886a16d27ed4a3ade3f07800797322bfd3468cd;p=emacs.git * imenu.el (imenu-default-create-index-function): Put back a version of the infinite loop test removed 2013-01-23. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 26ad7ec799a..aaa01698f12 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-01-30 Glenn Morris + + * imenu.el (imenu-default-create-index-function): + Put back a version of the infinite loop test removed 2013-01-23. + 2013-01-28 Fabián Ezequiel Gallina * progmodes/python.el (python-shell-parse-command): Find diff --git a/lisp/imenu.el b/lisp/imenu.el index b72cbeb42b4..0b5d69d6233 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el @@ -678,11 +678,13 @@ 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 (point)) + (let ((index-alist '()) (pos -1) name) (goto-char (point-max)) ;; Search for the function (while (funcall imenu-prev-index-position-function) + (when (= pos (point)) + (error "Infinite loop at %s:%d: imenu-prev-index-position-function does not move point" (buffer-name) pos)) (setq pos (point)) (save-excursion (setq name (funcall imenu-extract-index-name-function)))