Mercurial > emacs
comparison lisp/view.el @ 3450:89cd5536ee81
(View-scroll-lines-forward): If we exit, do nothing else.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 03 Jun 1993 06:34:58 +0000 |
parents | 5a563f113d6a |
children | 7b1b2a8d05f2 |
comparison
equal
deleted
inserted
replaced
3449:ad455da9b789 | 3450:89cd5536ee81 |
---|---|
329 "Scroll forward in View mode, or exit if end of text is visible. | 329 "Scroll forward in View mode, or exit if end of text is visible. |
330 No arg means whole window full, or number of lines set by \\[View-scroll-lines-forward-set-scroll-size]. | 330 No arg means whole window full, or number of lines set by \\[View-scroll-lines-forward-set-scroll-size]. |
331 Arg is number of lines to scroll." | 331 Arg is number of lines to scroll." |
332 (interactive "P") | 332 (interactive "P") |
333 (if (pos-visible-in-window-p (point-max)) | 333 (if (pos-visible-in-window-p (point-max)) |
334 (view-exit)) | 334 (view-exit) |
335 (setq lines | 335 (setq lines |
336 (if lines (prefix-numeric-value lines) | 336 (if lines (prefix-numeric-value lines) |
337 (view-scroll-size))) | 337 (view-scroll-size))) |
338 ; (view-last-command 'View-scroll-lines-forward lines) | 338 ;; (view-last-command 'View-scroll-lines-forward lines) |
339 (if (>= lines (view-window-size)) | 339 (if (>= lines (view-window-size)) |
340 (scroll-up nil) | 340 (scroll-up nil) |
341 (if (>= (- lines) (view-window-size)) | 341 (if (>= (- lines) (view-window-size)) |
342 (scroll-down nil) | 342 (scroll-down nil) |
343 (scroll-up lines))) | 343 (scroll-up lines))) |
344 (cond ((pos-visible-in-window-p (point-max)) | 344 (cond ((pos-visible-in-window-p (point-max)) |
345 (goto-char (point-max)) | 345 (goto-char (point-max)) |
346 (recenter -1) | 346 (recenter -1) |
347 (message (substitute-command-keys | 347 (message (substitute-command-keys |
348 "End. Type \\[view-exit] to quit viewing.")))) | 348 "End. Type \\[view-exit] to quit viewing.")))) |
349 (move-to-window-line -1) | 349 (move-to-window-line -1) |
350 (beginning-of-line)) | 350 (beginning-of-line))) |
351 | 351 |
352 (defun View-scroll-lines-forward-set-scroll-size (&optional lines) | 352 (defun View-scroll-lines-forward-set-scroll-size (&optional lines) |
353 "Scroll forward LINES lines in View mode, setting the \"scroll size\". | 353 "Scroll forward LINES lines in View mode, setting the \"scroll size\". |
354 This is the number of lines which \\[View-scroll-lines-forward] and \\[View-scroll-lines-backward] scroll by default. | 354 This is the number of lines which \\[View-scroll-lines-forward] and \\[View-scroll-lines-backward] scroll by default. |
355 The absolute value of LINES is used, so this command can be used to scroll | 355 The absolute value of LINES is used, so this command can be used to scroll |