diff options
| author | Glenn Morris | 2002-04-24 20:37:04 +0000 |
|---|---|---|
| committer | Glenn Morris | 2002-04-24 20:37:04 +0000 |
| commit | 5e9f6c446a7df491fc010ba948b98a3c48d0dc35 (patch) | |
| tree | 199f4566f6b371d0f3eacfcfa660c565f2adcb48 | |
| parent | beedfcf163bf8016ce6a569232838f5796aa9005 (diff) | |
| download | emacs-5e9f6c446a7df491fc010ba948b98a3c48d0dc35.tar.gz emacs-5e9f6c446a7df491fc010ba948b98a3c48d0dc35.zip | |
(scroll-all-function-all): New function to do the work of scrolling other
windows.
(scroll-all-scroll-down-all, scroll-all-scroll-up-all,
scroll-all-page-down-all, scroll-all-page-up-all,
scroll-all-beginning-of-buffer-all, scroll-all-end-of-buffer-all): Make
them use scroll-all-function-all.
| -rw-r--r-- | lisp/scroll-all.el | 71 |
1 files changed, 20 insertions, 51 deletions
diff --git a/lisp/scroll-all.el b/lisp/scroll-all.el index 3a9e019cb48..4548f954a7a 100644 --- a/lisp/scroll-all.el +++ b/lisp/scroll-all.el | |||
| @@ -46,7 +46,7 @@ | |||
| 46 | "Control/track scroll locking. | 46 | "Control/track scroll locking. |
| 47 | 47 | ||
| 48 | Setting this variable directly does not take effect; | 48 | Setting this variable directly does not take effect; |
| 49 | use either M-x customize or the function `scroll-all-mode'." | 49 | use either \\[customize] or the function `scroll-all-mode'." |
| 50 | :set (lambda (symbol value) (scroll-all-mode (if value 1 0))) | 50 | :set (lambda (symbol value) (scroll-all-mode (if value 1 0))) |
| 51 | :initialize 'custom-initialize-default | 51 | :initialize 'custom-initialize-default |
| 52 | :require 'scroll-all | 52 | :require 'scroll-all |
| @@ -59,81 +59,50 @@ use either M-x customize or the function `scroll-all-mode'." | |||
| 59 | (setq minor-mode-alist | 59 | (setq minor-mode-alist |
| 60 | (cons '(scroll-all-mode " *SL*") minor-mode-alist)))) | 60 | (cons '(scroll-all-mode " *SL*") minor-mode-alist)))) |
| 61 | 61 | ||
| 62 | (defun scroll-all-scroll-down-all (arg) | 62 | (defun scroll-all-function-all (func arg) |
| 63 | "Scroll down all visible windows." | 63 | "Apply function FUNC with argument ARG to all visible windows." |
| 64 | (interactive "P") | ||
| 65 | (let ((num-windows (count-windows)) | 64 | (let ((num-windows (count-windows)) |
| 66 | (count 1)) | 65 | (count 1)) |
| 67 | (when (> num-windows 1) | 66 | (when (> num-windows 1) |
| 68 | (other-window 1) | 67 | (other-window 1) |
| 69 | (while (< count num-windows) | 68 | (while (< count num-windows) |
| 70 | (if (not (eq (point) (point-max))) | 69 | (condition-case nil |
| 71 | (call-interactively 'next-line)) | 70 | (funcall func arg) |
| 71 | ;; Ignore beginning- or end-of-buffer error in other windows. | ||
| 72 | (error nil) | ||
| 73 | ) | ||
| 72 | (other-window 1) | 74 | (other-window 1) |
| 73 | (setq count (1+ count)))))) | 75 | (setq count (1+ count)))))) |
| 74 | 76 | ||
| 77 | (defun scroll-all-scroll-down-all (arg) | ||
| 78 | "Scroll down in all visible windows." | ||
| 79 | (interactive "p") | ||
| 80 | (scroll-all-function-all 'next-line arg)) | ||
| 81 | |||
| 75 | (defun scroll-all-scroll-up-all (arg) | 82 | (defun scroll-all-scroll-up-all (arg) |
| 76 | "Scroll up all visible windows." | 83 | "Scroll up in all visible windows." |
| 77 | (interactive "P") | 84 | (interactive "p") |
| 78 | (let ((num-windows (count-windows)) | 85 | (scroll-all-function-all 'previous-line arg)) |
| 79 | (count 1)) | ||
| 80 | (when (> num-windows 1) | ||
| 81 | (other-window 1) | ||
| 82 | (while (< count num-windows) | ||
| 83 | (if (not (eq (point) (point-min))) | ||
| 84 | (call-interactively 'previous-line)) | ||
| 85 | (other-window 1) | ||
| 86 | (setq count (1+ count)))))) | ||
| 87 | 86 | ||
| 88 | (defun scroll-all-page-down-all (arg) | 87 | (defun scroll-all-page-down-all (arg) |
| 89 | "Page down in all visible windows." | 88 | "Page down in all visible windows." |
| 90 | (interactive "P") | 89 | (interactive "P") |
| 91 | (let ((num-windows (count-windows)) | 90 | (scroll-all-function-all 'scroll-up arg)) |
| 92 | (count 1)) | ||
| 93 | (when (> num-windows 1) | ||
| 94 | (other-window 1) | ||
| 95 | (while (< count num-windows) | ||
| 96 | (condition-case nil | ||
| 97 | (call-interactively 'scroll-up) (end-of-buffer nil)) | ||
| 98 | (other-window 1) | ||
| 99 | (setq count (1+ count)))))) | ||
| 100 | 91 | ||
| 101 | (defun scroll-all-page-up-all (arg) | 92 | (defun scroll-all-page-up-all (arg) |
| 102 | "Page up in all visible windows." | 93 | "Page up in all visible windows." |
| 103 | (interactive "P") | 94 | (interactive "P") |
| 104 | (let ((num-windows (count-windows)) | 95 | (scroll-all-function-all 'scroll-down arg)) |
| 105 | (count 1)) | ||
| 106 | (when (> num-windows 1) | ||
| 107 | (other-window 1) | ||
| 108 | (while (< count num-windows) | ||
| 109 | (condition-case nil | ||
| 110 | (call-interactively 'scroll-down) (beginning-of-buffer nil)) | ||
| 111 | (other-window 1) | ||
| 112 | (setq count (1+ count)))))) | ||
| 113 | 96 | ||
| 114 | (defun scroll-all-beginning-of-buffer-all (arg) | 97 | (defun scroll-all-beginning-of-buffer-all (arg) |
| 115 | "Go to the beginning of the buffer in all visible windows." | 98 | "Go to the beginning of the buffer in all visible windows." |
| 116 | (interactive "P") | 99 | (interactive "P") |
| 117 | (let ((num-windows (count-windows)) | 100 | (scroll-all-function-all 'beginning-of-buffer arg)) |
| 118 | (count 1)) | ||
| 119 | (when (> num-windows 1) | ||
| 120 | (other-window 1) | ||
| 121 | (while (< count num-windows) | ||
| 122 | (call-interactively 'beginning-of-buffer) | ||
| 123 | (other-window 1) | ||
| 124 | (setq count (1+ count)))))) | ||
| 125 | 101 | ||
| 126 | (defun scroll-all-end-of-buffer-all (arg) | 102 | (defun scroll-all-end-of-buffer-all (arg) |
| 127 | "Go to the end of the buffer in all visible windows." | 103 | "Go to the end of the buffer in all visible windows." |
| 128 | (interactive "P") | 104 | (interactive "P") |
| 129 | (let ((num-windows (count-windows)) | 105 | (scroll-all-function-all 'end-of-buffer arg)) |
| 130 | (count 1)) | ||
| 131 | (when (> num-windows 1) | ||
| 132 | (other-window 1) | ||
| 133 | (while (< count num-windows) | ||
| 134 | (call-interactively 'end-of-buffer) | ||
| 135 | (other-window 1) | ||
| 136 | (setq count (1+ count)))))) | ||
| 137 | 106 | ||
| 138 | 107 | ||
| 139 | (defun scroll-all-check-to-scroll () | 108 | (defun scroll-all-check-to-scroll () |