# HG changeset patch # User Richard M. Stallman # Date 785676401 0 # Node ID a7b70665c93731c4ebee4b1f80024906010bcc8c # Parent 1a498b87fdbdf2f2f8170f98e046d5b3ef155887 (imenu): Widen temporary before scan the file. Widen if the user asks to move to an object that is outside the current accessible region. diff -r 1a498b87fdbd -r a7b70665c937 lisp/imenu.el --- a/lisp/imenu.el Thu Nov 24 08:51:11 1994 +0000 +++ b/lisp/imenu.el Thu Nov 24 11:26:41 1994 +0000 @@ -47,6 +47,7 @@ ;; [dean] - Dean Andrews ada@unison.com ;; [alon] - Alon Albert al@mercury.co.il ;; [greg] - Greg Thompson gregt@porsche.visix.COM +;; [kai] - Kai Grossjohann grossjoh@linus.informatik.uni-dortmund.de ;;; Code (eval-when-compile (require 'cl)) @@ -474,17 +475,26 @@ "Jump to a place in the buffer chosen using a buffer menu or mouse menu. See `imenu-choose-buffer-index' for more information." (interactive) - (let ((index-item (imenu-choose-buffer-index))) + (let ((index-item (save-restriction + (widen) + (imenu-choose-buffer-index)))) (and index-item (progn (push-mark) (cond ((markerp (cdr index-item)) + (if (or ( > (marker-position (cdr index-item)) (point-min)) + ( < (marker-position (cdr index-item)) (point-max))) + ;; widen if outside narrowing + (widen)) (goto-char (marker-position (cdr index-item)))) (t + (if (or ( > (cdr index-item) (point-min)) + ( < (cdr index-item) (point-max))) + ;; widen if outside narrowing + (widen)) (goto-char (cdr index-item)))))))) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; ;;;; Some examples of functions utilizing the framework of this