Subject: bug#13438: /srv/bzr/emacs/emacs-24 r111196: * imenu.el (imenu-default-create-index-function): Remove useless

From: Glenn Morris <[email-masked]>
Date: Thu, 24 Jan 2013 13:01:17 -0500

>   * imenu.el (imenu-default-create-index-function): Remove useless
>   infinite loop check.
[...]
> --- a/lisp/imenu.el	2013-01-01 09:11:05 +0000
> +++ b/lisp/imenu.el	2013-01-23 21:55:46 +0000
> @@ -683,8 +683,6 @@
>  	   (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)))

I'm not keen on removing an infinite loop check from emacs-24 at this
stage. Why is this issue (apparently) only seen in Python mode, and why
isn't there a Python-specific solution (which seems like it would be
just making imenu-prev-index-position-function return nil when
appropriate)?

Related discussion:
http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00536.html