changeset 16698:13920eac02e0

(imenu-generic-expression): Doc fix. (imenu--make-index-alist): Do `widen' and save-restriction here. (imenu): Not here.
author Richard M. Stallman <rms@gnu.org>
date Mon, 16 Dec 1996 07:39:34 +0000
parents 83946dc6f4e7
children 9cfa629723bf
files lisp/imenu.el
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/imenu.el	Mon Dec 16 06:01:18 1996 +0000
+++ b/lisp/imenu.el	Mon Dec 16 07:39:34 1996 +0000
@@ -119,7 +119,7 @@
 (defvar imenu-generic-expression nil
   "The regex pattern to use for creating a buffer index.
 
-If non-nil this pattern is passed to `imenu-create-index-with-pattern'
+If non-nil this pattern is passed to `imenu--generic-function'
 to create a buffer index.
 
 The value should be an alist with elements that look like this:
@@ -465,7 +465,9 @@
       ;; Get the index
       (setq imenu--index-alist
 	    (save-excursion
-	      (funcall imenu-create-index-function))))
+	      (save-restriction
+		(widen)
+		(funcall imenu-create-index-function)))))
   (or imenu--index-alist noerror
       (error "No items suitable for an index found in this buffer"))
   (or imenu--index-alist
@@ -881,10 +883,7 @@
 (defun imenu (index-item)
   "Jump to a place in the buffer chosen using a buffer menu or mouse menu.
 See `imenu-choose-buffer-index' for more information."
-  (interactive
-   (list (save-restriction 
-	   (widen)
-	   (imenu-choose-buffer-index))))
+  (interactive (list (imenu-choose-buffer-index)))
   ;; Convert a string to an alist element.
   (if (stringp index-item)
       (setq index-item (assoc index-item (imenu--make-index-alist))))