diff options
| -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'." | |||
| 63 | "Scroll down all visible windows." | 63 | "Scroll down all visible windows." |
| 64 | (interactive "P") | 64 | (interactive "P") |
| 65 | (let ((num-windows (count-windows)) | 65 | (let ((num-windows (count-windows)) |
| 66 | (count 1)) | 66 | (count 1)) |
| 67 | (if (> num-windows 1) | 67 | (when (> num-windows 1) |
| 68 | (progn (other-window 1) | 68 | (other-window 1) |
| 69 | (while (< count num-windows) | 69 | (while (< count num-windows) |
| 70 | (if (not (eq (point) (point-max))) | 70 | (if (not (eq (point) (point-max))) |
| 71 | (progn (call-interactively 'next-line))) | 71 | (call-interactively 'next-line)) |
| 72 | (other-window 1) | 72 | (other-window 1) |
| 73 | (setq count (1+ count))))))) | 73 | (setq count (1+ count)))))) |
| 74 | 74 | ||
| 75 | (defun scroll-all-scroll-up-all (arg) | 75 | (defun scroll-all-scroll-up-all (arg) |
| 76 | "Scroll up all visible windows." | 76 | "Scroll up all visible windows." |
| 77 | (interactive "P") | 77 | (interactive "P") |
| 78 | (let ((num-windows (count-windows)) | 78 | (let ((num-windows (count-windows)) |
| 79 | (count 1)) | 79 | (count 1)) |
| 80 | (if (> num-windows 1) | 80 | (when (> num-windows 1) |
| 81 | (progn (other-window 1) | 81 | (other-window 1) |
| 82 | (while (< count num-windows) | 82 | (while (< count num-windows) |
| 83 | (if (not (eq (point) (point-min))) | 83 | (if (not (eq (point) (point-min))) |
| 84 | (progn (call-interactively 'previous-line))) | 84 | (call-interactively 'previous-line)) |
| 85 | (other-window 1) | 85 | (other-window 1) |
| 86 | (setq count (1+ count))))))) | 86 | (setq count (1+ count)))))) |
| 87 | 87 | ||
| 88 | (defun scroll-all-page-down-all (arg) | 88 | (defun scroll-all-page-down-all (arg) |
| 89 | "Page down in all visible windows." | 89 | "Page down in all visible windows." |
| 90 | (interactive "P") | 90 | (interactive "P") |
| 91 | (let ((num-windows (count-windows)) | 91 | (let ((num-windows (count-windows)) |
| 92 | (count 1)) | 92 | (count 1)) |
| 93 | (if (> num-windows 1) | 93 | (when (> num-windows 1) |
| 94 | (progn (other-window 1) | 94 | (other-window 1) |
| 95 | (while (< count num-windows) | 95 | (while (< count num-windows) |
| 96 | (call-interactively 'scroll-up) | 96 | (condition-case nil |
| 97 | (other-window 1) | 97 | (call-interactively 'scroll-up) (end-of-buffer nil)) |
| 98 | (setq count (1+ count))))))) | 98 | (other-window 1) |
| 99 | (setq count (1+ count)))))) | ||
| 99 | 100 | ||
| 100 | (defun scroll-all-page-up-all (arg) | 101 | (defun scroll-all-page-up-all (arg) |
| 101 | "Page up in all visible windows." | 102 | "Page up in all visible windows." |
| 102 | (interactive "P") | 103 | (interactive "P") |
| 103 | (let ((num-windows (count-windows)) | 104 | (let ((num-windows (count-windows)) |
| 104 | (count 1)) | 105 | (count 1)) |
| 105 | (if (> num-windows 1) | 106 | (when (> num-windows 1) |
| 106 | (progn (other-window 1) | 107 | (other-window 1) |
| 107 | (while (< count num-windows) | 108 | (while (< count num-windows) |
| 108 | (call-interactively 'scroll-down) | 109 | (condition-case nil |
| 109 | (other-window 1) | 110 | (call-interactively 'scroll-down) (beginning-of-buffer nil)) |
| 110 | (setq count (1+ count))))))) | 111 | (other-window 1) |
| 112 | (setq count (1+ count)))))) | ||
| 113 | |||
| 114 | (defun scroll-all-beginning-of-buffer-all (arg) | ||
| 115 | "Go to the beginning of the buffer in all visible windows." | ||
| 116 | (interactive "P") | ||
| 117 | (let ((num-windows (count-windows)) | ||
| 118 | (count 1)) | ||
| 119 | (when (> num-windows 1) | ||
| 120 | (other-window 1) | ||
| 121 | (while (< count num-windows) | ||
| 122 | (beginning-of-buffer) | ||
| 123 | (other-window 1) | ||
| 124 | (setq count (1+ count)))))) | ||
| 125 | |||
| 126 | (defun scroll-all-end-of-buffer-all (arg) | ||
| 127 | "Go to the end of the buffer in all visible windows." | ||
| 128 | (interactive "P") | ||
| 129 | (let ((num-windows (count-windows)) | ||
| 130 | (count 1)) | ||
| 131 | (when (> num-windows 1) | ||
| 132 | (other-window 1) | ||
| 133 | (while (< count num-windows) | ||
| 134 | (end-of-buffer) | ||
| 135 | (other-window 1) | ||
| 136 | (setq count (1+ count)))))) | ||
| 111 | 137 | ||
| 112 | 138 | ||
| 113 | (defun scroll-all-check-to-scroll () | 139 | (defun scroll-all-check-to-scroll () |
| @@ -120,8 +146,12 @@ use either M-x customize or the function `scroll-all-mode'." | |||
| 120 | ((eq this-command 'scroll-up) | 146 | ((eq this-command 'scroll-up) |
| 121 | (call-interactively 'scroll-all-page-down-all)) | 147 | (call-interactively 'scroll-all-page-down-all)) |
| 122 | ((eq this-command 'scroll-down) | 148 | ((eq this-command 'scroll-down) |
| 123 | (call-interactively 'scroll-all-page-up-all)))) | 149 | (call-interactively 'scroll-all-page-up-all)) |
| 124 | 150 | ((eq this-command 'beginning-of-buffer) | |
| 151 | (call-interactively 'scroll-all-beginning-of-buffer-all)) | ||
| 152 | ((eq this-command 'end-of-buffer) | ||
| 153 | (call-interactively 'scroll-all-end-of-buffer-all)))) | ||
| 154 | |||
| 125 | 155 | ||
| 126 | ;;;###autoload | 156 | ;;;###autoload |
| 127 | (defun scroll-all-mode (arg) | 157 | (defun scroll-all-mode (arg) |