emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r99301: (imenu-default-create-index-f


From: Sam Steingold
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r99301: (imenu-default-create-index-function): Detect infinite
Date: Mon, 11 Jan 2010 15:57:28 -0500
User-agent: Bazaar (2.0.2)

------------------------------------------------------------
revno: 99301 [merge]
committer: Sam Steingold <address@hidden>
branch nick: trunk
timestamp: Mon 2010-01-11 15:57:28 -0500
message:
  (imenu-default-create-index-function): Detect infinite
  loops caused by imenu-prev-index-position-function.
modified:
  lisp/ChangeLog
  lisp/imenu.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-01-11 17:26:28 +0000
+++ b/lisp/ChangeLog    2010-01-11 20:53:23 +0000
@@ -1,3 +1,8 @@
+2010-01-11  Sam Steingold  <address@hidden>
+
+       * imenu.el (imenu-default-create-index-function): Detect infinite
+       loops caused by imenu-prev-index-position-function.
+
 2010-01-11  Juanma Barranquero  <address@hidden>
 
        * htmlfontify.el (htmlfontify-load-rgb-file)

=== modified file 'lisp/imenu.el'
--- a/lisp/imenu.el     2010-01-04 05:35:18 +0000
+++ b/lisp/imenu.el     2010-01-11 20:53:23 +0000
@@ -596,7 +596,7 @@
 ;;; Find all markers in alist and makes
 ;;; them point nowhere.
 ;;; The top-level call uses nil as the argument;
-;;; non-nil arguments are in recursivecalls.
+;;; non-nil arguments are in recursive calls.
 (defvar imenu--cleanup-seen)
 
 (defun imenu--cleanup (&optional alist)
@@ -684,12 +684,15 @@
   ;; 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 '())
+        (let ((index-alist '()) (pos (point))
               prev-pos name)
           (goto-char (point-max))
           (imenu-progress-message prev-pos 0 t)
           ;; 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))
             (imenu-progress-message prev-pos nil t)
             (save-excursion
               (setq name (funcall imenu-extract-index-name-function)))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]