From 1886a16d27ed4a3ade3f07800797322bfd3468cd Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 29 Jan 2013 23:46:28 -0800 Subject: [PATCH] * imenu.el (imenu-default-create-index-function): Put back a version of the infinite loop test removed 2013-01-23. --- lisp/ChangeLog | 5 +++++ lisp/imenu.el | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) 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))) -- 2.39.2