Article View: gnu.emacs.bug
Article #1813Re: view.el: why does View-scroll-lines-forward exit?
From: Stephen Gildea
Date: Wed, 03 Jan 1990 18:59
Date: Wed, 03 Jan 1990 18:59
88 lines
3515 bytes
3515 bytes
View-scroll-lines-forward in view.el prints a message suggesting
typing the 'exit-recursive-edit' key when you reach the end; however,
it has code to exit-recursive-edit the next time
View-scroll-lines-forward is called, as with the next space or
control-v.
Is this a bug, and if not, can it be made configurable (e.g.,
view-mode-exit-at-end)?
It's a feature, not a bug. The following diffs should satisfy you.
They change the message in the echo area to tell you that SPC also
exits, and add a user variable, view-scroll-forward-exits, to turn off
this behavior.
< Stephen
diff -c /usr/local/emacs/lisp/view.el view.el
*** /usr/local/emacs/lisp/view.el Sun Aug 21 21:04:47 1988
--- view.el Tue Jan 2 11:32:19 1990
***************
*** 22,27 ****
--- 22,31 ----
(provide 'view)
+ (defvar view-scroll-forward-exits t
+ "*Non-nil to have \\[View-scroll-lines-forward] exit View mode when at EOF.
+ If nil, an explicit \\[exit-recursive-edit] must be typed.")
+
(defvar view-mode-map nil)
(if view-mode-map
nil
***************
*** 249,260 ****
(recenter (/ (view-window-size) 2)))
(defun View-scroll-lines-forward (&optional lines)
! "Scroll forward in View mode, or exit if end of text is visible.
No arg means whole window full, or number of lines set by \\[View-scroll-lines
-forward-set-scroll-size].
Arg is number of lines to scroll."
(interactive "P")
! (if (pos-visible-in-window-p (point-max))
! (exit-recursive-edit))
(setq lines
(if lines (prefix-numeric-value lines)
(view-scroll-size)))
--- 253,266 ----
(recenter (/ (view-window-size) 2)))
(defun View-scroll-lines-forward (&optional lines)
! "Scroll forward in View mode.
! Exits if end of text is visible and view-scroll-forward-exits is non-nil.
No arg means whole window full, or number of lines set by \\[View-scroll-lines
-forward-set-scroll-size].
Arg is number of lines to scroll."
(interactive "P")
! (and (pos-visible-in-window-p (point-max))
! view-scroll-forward-exits
! (exit-recursive-edit))
(setq lines
(if lines (prefix-numeric-value lines)
(view-scroll-size)))
***************
*** 267,274 ****
(cond ((pos-visible-in-window-p (point-max))
(goto-char (point-max))
(recenter -1)
! (message (substitute-command-keys
! "End. Type \\[exit-recursive-edit] to quit viewing."))))
(move-to-window-line -1)
(beginning-of-line))
--- 273,283 ----
(cond ((pos-visible-in-window-p (point-max))
(goto-char (point-max))
(recenter -1)
! (if view-scroll-forward-exits
! (message (substitute-command-keys
! "End. Scrolling forward or typing \\[exit-recursive-edit
] quits viewing."))
! (message (substitute-command-keys
! "End. Type \\[exit-recursive-edit] to quit viewing.")))))
(move-to-window-line -1)
(beginning-of-line))
Technical Details
Message-ID:
<9001031901.AA08616@life.ai.mit.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ALEXANDER.BBN.COM!gildeaShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ALEXANDER.BBN.COM!gildea From: gildea@ALEXANDER.BBN.COM (Stephen Gildea) Newsgroups: gnu.emacs.bug Subject: Re: view.el: why does View-scroll-lines-forward exit? Message-ID: <9001031901.AA08616@life.ai.mit.edu> Date: 3 Jan 90 18:59:44 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 88