mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-04-27 08:43:40 -07:00
(widen-automatically): New variable.
(pop-global-mark): Obey widen-automatically.
This commit is contained in:
parent
473671bd82
commit
d0c4882d9e
1 changed files with 11 additions and 1 deletions
|
|
@ -3201,6 +3201,14 @@ Invoke \\[apropos-documentation] and type \"transient\" or
|
|||
commands which are sensitive to the Transient Mark mode."
|
||||
:global t :group 'editing-basics :require nil)
|
||||
|
||||
(defvar widen-automatically t
|
||||
"Non-nil means it is ok for commands to call `widen' when they want to.
|
||||
Some commands will do this in order to go to positions outside
|
||||
the current accessible part of the buffer.
|
||||
|
||||
If `widen-automatically' is nil, these commands will do something else
|
||||
as a fallback, and won't change the buffer bounds.")
|
||||
|
||||
(defun pop-global-mark ()
|
||||
"Pop off global mark ring and jump to the top location."
|
||||
(interactive)
|
||||
|
|
@ -3217,7 +3225,9 @@ commands which are sensitive to the Transient Mark mode."
|
|||
(set-buffer buffer)
|
||||
(or (and (>= position (point-min))
|
||||
(<= position (point-max)))
|
||||
(widen))
|
||||
(if widen-automatically
|
||||
(error "Global mark position is outside accessible part of buffer")
|
||||
(widen)))
|
||||
(goto-char position)
|
||||
(switch-to-buffer buffer)))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue