diff options
author | Glenn Morris <rgm@gnu.org> | 2002-04-21 16:30:28 +0000 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2002-04-21 16:30:28 +0000 |
commit | 6036654ee8ea9bb2a78a5eca6e6455160b3552f2 (patch) | |
tree | 109ba6cd4429ab3920215fcf77a3396524fb9b89 /lisp/scroll-all.el | |
parent | 75272a3a3dfec64041e927b0bc98dcf56d541562 (diff) | |
download | emacs-6036654ee8ea9bb2a78a5eca6e6455160b3552f2.tar.gz emacs-6036654ee8ea9bb2a78a5eca6e6455160b3552f2.tar.bz2 emacs-6036654ee8ea9bb2a78a5eca6e6455160b3552f2.zip |
(scroll-all-page-down-all, scroll-all-page-up-all): Ignore the error if one
of the other windows being scrolled reaches the end/start of its buffer.
(scroll-all-beginning-of-buffer-all, scroll-all-end-of-buffer-all): New
functions to track `beginning-of-buffer' and `end-of-buffer'.
Diffstat (limited to 'lisp/scroll-all.el')
-rw-r--r-- | lisp/scroll-all.el | 94 |
1 files changed, 62 insertions, 32 deletions
diff --git a/lisp/scroll-all.el b/lisp/scroll-all.el index a25f30eefe0..0126a601617 100644 --- a/lisp/scroll-all.el +++ b/lisp/scroll-all.el @@ -63,51 +63,77 @@ use either M-x customize or the function `scroll-all-mode'." "Scroll down all visible windows." (interactive "P") (let ((num-windows (count-windows)) - (count 1)) - (if (> num-windows 1) - (progn (other-window 1) - (while (< count num-windows) - (if (not (eq (point) (point-max))) - (progn (call-interactively 'next-line))) - (other-window 1) - (setq count (1+ count))))))) + (count 1)) + (when (> num-windows 1) + (other-window 1) + (while (< count num-windows) + (if (not (eq (point) (point-max))) + (call-interactively 'next-line)) + (other-window 1) + (setq count (1+ count)))))) (defun scroll-all-scroll-up-all (arg) "Scroll up all visible windows." (interactive "P") (let ((num-windows (count-windows)) - (count 1)) - (if (> num-windows 1) - (progn (other-window 1) - (while (< count num-windows) - (if (not (eq (point) (point-min))) - (progn (call-interactively 'previous-line))) - (other-window 1) - (setq count (1+ count))))))) + (count 1)) + (when (> num-windows 1) + (other-window 1) + (while (< count num-windows) + (if (not (eq (point) (point-min))) + (call-interactively 'previous-line)) + (other-window 1) + (setq count (1+ count)))))) (defun scroll-all-page-down-all (arg) "Page down in all visible windows." (interactive "P") (let ((num-windows (count-windows)) - (count 1)) - (if (> num-windows 1) - (progn (other-window 1) - (while (< count num-windows) - (call-interactively 'scroll-up) - (other-window 1) - (setq count (1+ count))))))) + (count 1)) + (when (> num-windows 1) + (other-window 1) + (while (< count num-windows) + (condition-case nil + (call-interactively 'scroll-up) (end-of-buffer nil)) + (other-window 1) + (setq count (1+ count)))))) (defun scroll-all-page-up-all (arg) "Page up in all visible windows." (interactive "P") (let ((num-windows (count-windows)) - (count 1)) - (if (> num-windows 1) - (progn (other-window 1) - (while (< count num-windows) - (call-interactively 'scroll-down) - (other-window 1) - (setq count (1+ count))))))) + (count 1)) + (when (> num-windows 1) + (other-window 1) + (while (< count num-windows) + (condition-case nil + (call-interactively 'scroll-down) (beginning-of-buffer nil)) + (other-window 1) + (setq count (1+ count)))))) + +(defun scroll-all-beginning-of-buffer-all (arg) + "Go to the beginning of the buffer in all visible windows." + (interactive "P") + (let ((num-windows (count-windows)) + (count 1)) + (when (> num-windows 1) + (other-window 1) + (while (< count num-windows) + (beginning-of-buffer) + (other-window 1) + (setq count (1+ count)))))) + +(defun scroll-all-end-of-buffer-all (arg) + "Go to the end of the buffer in all visible windows." + (interactive "P") + (let ((num-windows (count-windows)) + (count 1)) + (when (> num-windows 1) + (other-window 1) + (while (< count num-windows) + (end-of-buffer) + (other-window 1) + (setq count (1+ count)))))) (defun scroll-all-check-to-scroll () @@ -120,8 +146,12 @@ use either M-x customize or the function `scroll-all-mode'." ((eq this-command 'scroll-up) (call-interactively 'scroll-all-page-down-all)) ((eq this-command 'scroll-down) - (call-interactively 'scroll-all-page-up-all)))) - + (call-interactively 'scroll-all-page-up-all)) + ((eq this-command 'beginning-of-buffer) + (call-interactively 'scroll-all-beginning-of-buffer-all)) + ((eq this-command 'end-of-buffer) + (call-interactively 'scroll-all-end-of-buffer-all)))) + ;;;###autoload (defun scroll-all-mode (arg) |