changeset 57521:3ac03a07be63

(view-mode-enable): Set view-page-size and view-half-page-size to nil. (view-set-half-page-size-default): view-half-page-size = nil means the default. (View-scroll-page-forward): Use view-page-size-default. (View-scroll-page-backward): Likewise. (view-page-size, view-half-page-size): Doc fixes.
author Richard M. Stallman <rms@gnu.org>
date Sat, 16 Oct 2004 15:24:34 +0000
parents b7788b1f6e70
children 3f7aa44cf697
files lisp/view.el
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/view.el	Sat Oct 16 15:22:00 2004 +0000
+++ b/lisp/view.el	Sat Oct 16 15:24:34 2004 +0000
@@ -117,12 +117,12 @@
 
 (defvar view-page-size nil
   "Default number of lines to scroll by View page commands.
-If nil then the local value of this is initially set to window size.")
+If nil that means use the window size.")
 (make-variable-buffer-local 'view-page-size)
 
 (defvar view-half-page-size nil
   "Default number of lines to scroll by View half page commands.
-If nil then the local value of this is initially set to half window size.")
+If nil that means use half the window size.")
 (make-variable-buffer-local 'view-half-page-size)
 
 (defvar view-last-regexp nil)
@@ -453,8 +453,8 @@
   ;; This is to guarantee that the buffer-read-only variable is restored.
   (add-hook 'change-major-mode-hook 'view-mode-disable nil t)
   (setq view-mode t
-	view-page-size (view-page-size-default view-page-size)
-	view-half-page-size (or view-half-page-size (/ (view-window-size) 2))
+	view-page-size nil
+	view-half-page-size nil
 	view-old-buffer-read-only buffer-read-only
 	buffer-read-only t
 	view-old-Helper-return-blurb (and (boundp 'Helper-return-blurb)
@@ -675,7 +675,8 @@
 
 (defun view-set-half-page-size-default (lines)
   ;; Get and maybe set half page size.
-  (if (not lines) view-half-page-size
+  (if (not lines) (or view-half-page-size
+		      (/ (view-window-size) 2))
     (setq view-half-page-size
 	  (if (zerop (setq lines (prefix-numeric-value lines)))
 	      (/ (view-window-size) 2)
@@ -803,13 +804,13 @@
 \\[View-scroll-page-backward-set-page-size].
 If LINES is more than a window-full, only the last window-full is shown."
   (interactive "P")
-  (view-scroll-lines lines nil view-page-size nil))
+  (view-scroll-lines lines nil (view-page-size-default view-page-size) nil))
 
 (defun View-scroll-page-backward (&optional lines)
   "Scroll \"page size\" or prefix LINES lines backward in View mode.
 See also `View-scroll-page-forward'."
   (interactive "P")
-  (view-scroll-lines lines t view-page-size nil))
+  (view-scroll-lines lines t (view-page-size-default view-page-size) nil))
 
 (defun View-scroll-page-forward-set-page-size (&optional lines)
   "Scroll forward LINES lines in View mode, setting the \"page size\".