diff options
| author | Glenn Morris | 2013-02-01 00:23:47 -0800 |
|---|---|---|
| committer | Glenn Morris | 2013-02-01 00:23:47 -0800 |
| commit | 48c828b923a1c8f0b3350be96fcc9ec8a7c21dbc (patch) | |
| tree | f3db1b662699e18d68d80f4a26fc75a066819d26 | |
| parent | cd87ae10a83f64f6afa24d8611f1d10aa3c09086 (diff) | |
| download | emacs-48c828b923a1c8f0b3350be96fcc9ec8a7c21dbc.tar.gz emacs-48c828b923a1c8f0b3350be96fcc9ec8a7c21dbc.zip | |
* imenu.el (imenu-default-create-index-function):
Tweak infinite loop test to check for forward motion as well as none.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/imenu.el | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a05d0fc0347..e2bb42b62a1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-02-01 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * imenu.el (imenu-default-create-index-function): | ||
| 4 | Tweak infinite loop test to check for forward motion as well as none. | ||
| 5 | |||
| 1 | 2013-02-01 Alex Harsanyi <AlexHarsanyi@gmail.com> | 6 | 2013-02-01 Alex Harsanyi <AlexHarsanyi@gmail.com> |
| 2 | 7 | ||
| 3 | * net/soap-client.el (soap-invoke): Encode the string for | 8 | * net/soap-client.el (soap-invoke): Encode the string for |
diff --git a/lisp/imenu.el b/lisp/imenu.el index 80fc441c896..c1077a49d1a 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el | |||
| @@ -676,12 +676,12 @@ The alternate method, which is the one most often used, is to call | |||
| 676 | ;; in these major modes. But save that change for later. | 676 | ;; in these major modes. But save that change for later. |
| 677 | (cond ((and imenu-prev-index-position-function | 677 | (cond ((and imenu-prev-index-position-function |
| 678 | imenu-extract-index-name-function) | 678 | imenu-extract-index-name-function) |
| 679 | (let ((index-alist '()) (pos -1) | 679 | (let ((index-alist '()) (pos (point-max)) |
| 680 | name) | 680 | name) |
| 681 | (goto-char (point-max)) | 681 | (goto-char pos) |
| 682 | ;; Search for the function | 682 | ;; Search for the function |
| 683 | (while (funcall imenu-prev-index-position-function) | 683 | (while (funcall imenu-prev-index-position-function) |
| 684 | (when (= pos (point)) | 684 | (unless (< (point) pos) |
| 685 | (error "Infinite loop at %s:%d: imenu-prev-index-position-function does not move point" (buffer-name) pos)) | 685 | (error "Infinite loop at %s:%d: imenu-prev-index-position-function does not move point" (buffer-name) pos)) |
| 686 | (setq pos (point)) | 686 | (setq pos (point)) |
| 687 | (save-excursion | 687 | (save-excursion |