46 |
"Control/track scroll locking. |
"Control/track scroll locking. |
47 |
|
|
48 |
Setting this variable directly does not take effect; |
Setting this variable directly does not take effect; |
49 |
use either M-x customize or the function `scroll-all-mode'." |
use either \\[customize] or the function `scroll-all-mode'." |
50 |
:set (lambda (symbol value) (scroll-all-mode (if value 1 0))) |
:set (lambda (symbol value) (scroll-all-mode (if value 1 0))) |
51 |
:initialize 'custom-initialize-default |
:initialize 'custom-initialize-default |
52 |
:require 'scroll-all |
:require 'scroll-all |
59 |
(setq minor-mode-alist |
(setq minor-mode-alist |
60 |
(cons '(scroll-all-mode " *SL*") minor-mode-alist)))) |
(cons '(scroll-all-mode " *SL*") minor-mode-alist)))) |
61 |
|
|
62 |
(defun scroll-all-scroll-down-all (arg) |
(defun scroll-all-function-all (func arg) |
63 |
"Scroll down all visible windows." |
"Apply function FUNC with argument ARG to all visible windows." |
|
(interactive "P") |
|
64 |
(let ((num-windows (count-windows)) |
(let ((num-windows (count-windows)) |
65 |
(count 1)) |
(count 1)) |
66 |
(when (> num-windows 1) |
(when (> num-windows 1) |
67 |
(other-window 1) |
(other-window 1) |
68 |
(while (< count num-windows) |
(while (< count num-windows) |
69 |
(if (not (eq (point) (point-max))) |
(condition-case nil |
70 |
(call-interactively 'next-line)) |
(funcall func arg) |
71 |
|
;; Ignore beginning- or end-of-buffer error in other windows. |
72 |
|
(error nil) |
73 |
|
) |
74 |
(other-window 1) |
(other-window 1) |
75 |
(setq count (1+ count)))))) |
(setq count (1+ count)))))) |
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 |
|
|
82 |
(defun scroll-all-scroll-up-all (arg) |
(defun scroll-all-scroll-up-all (arg) |
83 |
"Scroll up all visible windows." |
"Scroll up in all visible windows." |
84 |
(interactive "P") |
(interactive "p") |
85 |
(let ((num-windows (count-windows)) |
(scroll-all-function-all 'previous-line arg)) |
|
(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)))))) |
|
86 |
|
|
87 |
(defun scroll-all-page-down-all (arg) |
(defun scroll-all-page-down-all (arg) |
88 |
"Page down in all visible windows." |
"Page down in all visible windows." |
89 |
(interactive "P") |
(interactive "P") |
90 |
(let ((num-windows (count-windows)) |
(scroll-all-function-all 'scroll-up arg)) |
|
(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)))))) |
|
91 |
|
|
92 |
(defun scroll-all-page-up-all (arg) |
(defun scroll-all-page-up-all (arg) |
93 |
"Page up in all visible windows." |
"Page up in all visible windows." |
94 |
(interactive "P") |
(interactive "P") |
95 |
(let ((num-windows (count-windows)) |
(scroll-all-function-all 'scroll-down arg)) |
|
(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)))))) |
|
96 |
|
|
97 |
(defun scroll-all-beginning-of-buffer-all (arg) |
(defun scroll-all-beginning-of-buffer-all (arg) |
98 |
"Go to the beginning of the buffer in all visible windows." |
"Go to the beginning of the buffer in all visible windows." |
99 |
(interactive "P") |
(interactive "P") |
100 |
(let ((num-windows (count-windows)) |
(scroll-all-function-all 'beginning-of-buffer arg)) |
|
(count 1)) |
|
|
(when (> num-windows 1) |
|
|
(other-window 1) |
|
|
(while (< count num-windows) |
|
|
(call-interactively 'beginning-of-buffer) |
|
|
(other-window 1) |
|
|
(setq count (1+ count)))))) |
|
101 |
|
|
102 |
(defun scroll-all-end-of-buffer-all (arg) |
(defun scroll-all-end-of-buffer-all (arg) |
103 |
"Go to the end of the buffer in all visible windows." |
"Go to the end of the buffer in all visible windows." |
104 |
(interactive "P") |
(interactive "P") |
105 |
(let ((num-windows (count-windows)) |
(scroll-all-function-all 'end-of-buffer arg)) |
|
(count 1)) |
|
|
(when (> num-windows 1) |
|
|
(other-window 1) |
|
|
(while (< count num-windows) |
|
|
(call-interactively 'end-of-buffer) |
|
|
(other-window 1) |
|
|
(setq count (1+ count)))))) |
|
106 |
|
|
107 |
|
|
108 |
(defun scroll-all-check-to-scroll () |
(defun scroll-all-check-to-scroll () |