diff options
| author | Richard M. Stallman | 1996-12-16 07:39:34 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-12-16 07:39:34 +0000 |
| commit | 01e980fb08b0c1781e44b85071f609090e11bf20 (patch) | |
| tree | 3816d7f3565cdc60b8eccc727b6339233f000752 | |
| parent | 6a7eabe0c65144f10b60ffe3f7c7709846641689 (diff) | |
| download | emacs-01e980fb08b0c1781e44b85071f609090e11bf20.tar.gz emacs-01e980fb08b0c1781e44b85071f609090e11bf20.zip | |
(imenu-generic-expression): Doc fix.
(imenu--make-index-alist): Do `widen' and save-restriction here.
(imenu): Not here.
| -rw-r--r-- | lisp/imenu.el | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lisp/imenu.el b/lisp/imenu.el index ff909cd227e..1ddd70dcfd2 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el | |||
| @@ -119,7 +119,7 @@ with name concatenation.") | |||
| 119 | (defvar imenu-generic-expression nil | 119 | (defvar imenu-generic-expression nil |
| 120 | "The regex pattern to use for creating a buffer index. | 120 | "The regex pattern to use for creating a buffer index. |
| 121 | 121 | ||
| 122 | If non-nil this pattern is passed to `imenu-create-index-with-pattern' | 122 | If non-nil this pattern is passed to `imenu--generic-function' |
| 123 | to create a buffer index. | 123 | to create a buffer index. |
| 124 | 124 | ||
| 125 | The value should be an alist with elements that look like this: | 125 | The value should be an alist with elements that look like this: |
| @@ -465,7 +465,9 @@ as a way for the user to ask to recalculate the buffer's index alist." | |||
| 465 | ;; Get the index | 465 | ;; Get the index |
| 466 | (setq imenu--index-alist | 466 | (setq imenu--index-alist |
| 467 | (save-excursion | 467 | (save-excursion |
| 468 | (funcall imenu-create-index-function)))) | 468 | (save-restriction |
| 469 | (widen) | ||
| 470 | (funcall imenu-create-index-function))))) | ||
| 469 | (or imenu--index-alist noerror | 471 | (or imenu--index-alist noerror |
| 470 | (error "No items suitable for an index found in this buffer")) | 472 | (error "No items suitable for an index found in this buffer")) |
| 471 | (or imenu--index-alist | 473 | (or imenu--index-alist |
| @@ -881,10 +883,7 @@ See the command `imenu' for more information." | |||
| 881 | (defun imenu (index-item) | 883 | (defun imenu (index-item) |
| 882 | "Jump to a place in the buffer chosen using a buffer menu or mouse menu. | 884 | "Jump to a place in the buffer chosen using a buffer menu or mouse menu. |
| 883 | See `imenu-choose-buffer-index' for more information." | 885 | See `imenu-choose-buffer-index' for more information." |
| 884 | (interactive | 886 | (interactive (list (imenu-choose-buffer-index))) |
| 885 | (list (save-restriction | ||
| 886 | (widen) | ||
| 887 | (imenu-choose-buffer-index)))) | ||
| 888 | ;; Convert a string to an alist element. | 887 | ;; Convert a string to an alist element. |
| 889 | (if (stringp index-item) | 888 | (if (stringp index-item) |
| 890 | (setq index-item (assoc index-item (imenu--make-index-alist)))) | 889 | (setq index-item (assoc index-item (imenu--make-index-alist)))) |