1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

* imenu.el (imenu-default-create-index-function):

Put back a version of the infinite loop test removed 2013-01-23.
This commit is contained in:
Glenn Morris 2013-01-29 23:46:28 -08:00
parent e44970863d
commit 1886a16d27
2 changed files with 8 additions and 1 deletions

View file

@ -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)))