aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2005-05-01 18:54:00 +0000
committerRichard M. Stallman2005-05-01 18:54:00 +0000
commitd0c4882d9e60544cc7bc5fade73e9f8265199f6d (patch)
treeb8c06217176a3be67d60d4a8aa54332a8121a0b8
parent473671bd827bc37ff2ad55e975ee8e33c0dca9fb (diff)
downloademacs-d0c4882d9e60544cc7bc5fade73e9f8265199f6d.tar.gz
emacs-d0c4882d9e60544cc7bc5fade73e9f8265199f6d.zip
(widen-automatically): New variable.
(pop-global-mark): Obey widen-automatically.
-rw-r--r--lisp/simple.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 9b49eb28cc8..73c01e98f61 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3201,6 +3201,14 @@ Invoke \\[apropos-documentation] and type \"transient\" or
3201commands which are sensitive to the Transient Mark mode." 3201commands which are sensitive to the Transient Mark mode."
3202 :global t :group 'editing-basics :require nil) 3202 :global t :group 'editing-basics :require nil)
3203 3203
3204(defvar widen-automatically t
3205 "Non-nil means it is ok for commands to call `widen' when they want to.
3206Some commands will do this in order to go to positions outside
3207the current accessible part of the buffer.
3208
3209If `widen-automatically' is nil, these commands will do something else
3210as a fallback, and won't change the buffer bounds.")
3211
3204(defun pop-global-mark () 3212(defun pop-global-mark ()
3205 "Pop off global mark ring and jump to the top location." 3213 "Pop off global mark ring and jump to the top location."
3206 (interactive) 3214 (interactive)
@@ -3217,7 +3225,9 @@ commands which are sensitive to the Transient Mark mode."
3217 (set-buffer buffer) 3225 (set-buffer buffer)
3218 (or (and (>= position (point-min)) 3226 (or (and (>= position (point-min))
3219 (<= position (point-max))) 3227 (<= position (point-max)))
3220 (widen)) 3228 (if widen-automatically
3229 (error "Global mark position is outside accessible part of buffer")
3230 (widen)))
3221 (goto-char position) 3231 (goto-char position)
3222 (switch-to-buffer buffer))) 3232 (switch-to-buffer buffer)))
3223 3233