comparison lisp/simple.el @ 61986:91b85d61710d

(widen-automatically): New variable. (pop-global-mark): Obey widen-automatically.
author Richard M. Stallman <rms@gnu.org>
date Sun, 01 May 2005 18:54:00 +0000
parents 5f3a630ef0ac
children 1f57a1631e42
comparison
equal deleted inserted replaced
61985:2afdce105d7a 61986:91b85d61710d
3199 Invoke \\[apropos-documentation] and type \"transient\" or 3199 Invoke \\[apropos-documentation] and type \"transient\" or
3200 \"mark.*active\" at the prompt, to see the documentation of 3200 \"mark.*active\" at the prompt, to see the documentation of
3201 commands which are sensitive to the Transient Mark mode." 3201 commands 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.
3206 Some commands will do this in order to go to positions outside
3207 the current accessible part of the buffer.
3208
3209 If `widen-automatically' is nil, these commands will do something else
3210 as 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)
3207 ;; Pop entries which refer to non-existent buffers. 3215 ;; Pop entries which refer to non-existent buffers.
3208 (while (and global-mark-ring (not (marker-buffer (car global-mark-ring)))) 3216 (while (and global-mark-ring (not (marker-buffer (car global-mark-ring))))
3215 (setq global-mark-ring (nconc (cdr global-mark-ring) 3223 (setq global-mark-ring (nconc (cdr global-mark-ring)
3216 (list (car global-mark-ring)))) 3224 (list (car global-mark-ring))))
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
3224 (defcustom next-line-add-newlines nil 3234 (defcustom next-line-add-newlines nil
3225 "*If non-nil, `next-line' inserts newline to avoid `end of buffer' error." 3235 "*If non-nil, `next-line' inserts newline to avoid `end of buffer' error."