/[emacs]/emacs/lisp/scroll-all.el
ViewVC logotype

Diff of /emacs/lisp/scroll-all.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by gm, Sun Apr 21 17:36:16 2002 UTC revision 1.9 by rms, Mon Apr 22 07:50:50 2002 UTC
# Line 63  use either M-x customize or the function Line 63  use either M-x customize or the function
63    "Scroll down all visible windows."    "Scroll down all visible windows."
64    (interactive "P")    (interactive "P")
65    (let ((num-windows (count-windows))    (let ((num-windows (count-windows))
66                  (count 1))          (count 1))
67      (when (> num-windows 1)      (when (> num-windows 1)
68            (other-window 1)        (other-window 1)
69            (while (< count num-windows)        (while (< count num-windows)
70                  (if (not (eq (point) (point-max)))          (if (not (eq (point) (point-max)))
71                          (call-interactively 'next-line))              (call-interactively 'next-line))
72                  (other-window 1)          (other-window 1)
73                  (setq count (1+ count))))))          (setq count (1+ count))))))
74    
75  (defun scroll-all-scroll-up-all (arg)  (defun scroll-all-scroll-up-all (arg)
76    "Scroll up all visible windows."    "Scroll up all visible windows."
77    (interactive "P")    (interactive "P")
78    (let ((num-windows (count-windows))    (let ((num-windows (count-windows))
79                  (count 1))          (count 1))
80      (when (> num-windows 1)      (when (> num-windows 1)
81            (other-window 1)        (other-window 1)
82            (while (< count num-windows)        (while (< count num-windows)
83                  (if (not (eq (point) (point-min)))          (if (not (eq (point) (point-min)))
84                          (call-interactively 'previous-line))              (call-interactively 'previous-line))
85                  (other-window 1)          (other-window 1)
86                  (setq count (1+ count))))))          (setq count (1+ count))))))
87    
88  (defun scroll-all-page-down-all (arg)  (defun scroll-all-page-down-all (arg)
89    "Page down in all visible windows."    "Page down in all visible windows."
90    (interactive "P")    (interactive "P")
91    (let ((num-windows (count-windows))    (let ((num-windows (count-windows))
92                  (count 1))          (count 1))
93      (when (> num-windows 1)      (when (> num-windows 1)
94            (other-window 1)        (other-window 1)
95            (while (< count num-windows)        (while (< count num-windows)
96                  (condition-case nil          (condition-case nil
97                          (call-interactively 'scroll-up) (end-of-buffer nil))              (call-interactively 'scroll-up) (end-of-buffer nil))
98                  (other-window 1)          (other-window 1)
99                  (setq count (1+ count))))))          (setq count (1+ count))))))
100    
101  (defun scroll-all-page-up-all (arg)  (defun scroll-all-page-up-all (arg)
102    "Page up in all visible windows."    "Page up in all visible windows."
103    (interactive "P")    (interactive "P")
104    (let ((num-windows (count-windows))    (let ((num-windows (count-windows))
105                  (count 1))          (count 1))
106      (when (> num-windows 1)      (when (> num-windows 1)
107            (other-window 1)        (other-window 1)
108            (while (< count num-windows)        (while (< count num-windows)
109                  (condition-case nil          (condition-case nil
110                          (call-interactively 'scroll-down) (beginning-of-buffer nil))              (call-interactively 'scroll-down) (beginning-of-buffer nil))
111                  (other-window 1)          (other-window 1)
112                  (setq count (1+ count))))))          (setq count (1+ count))))))
113    
114  (defun scroll-all-beginning-of-buffer-all (arg)  (defun scroll-all-beginning-of-buffer-all (arg)
115    "Go to the beginning of the buffer in all visible windows."    "Go to the beginning of the buffer in all visible windows."
116    (interactive "P")    (interactive "P")
117    (let ((num-windows (count-windows))    (let ((num-windows (count-windows))
118                  (count 1))          (count 1))
119      (when (> num-windows 1)      (when (> num-windows 1)
120            (other-window 1)        (other-window 1)
121            (while (< count num-windows)        (while (< count num-windows)
122                  (call-interactively 'beginning-of-buffer)          (call-interactively 'beginning-of-buffer)
123                  (other-window 1)          (other-window 1)
124                  (setq count (1+ count))))))          (setq count (1+ count))))))
125    
126  (defun scroll-all-end-of-buffer-all (arg)  (defun scroll-all-end-of-buffer-all (arg)
127    "Go to the end of the buffer in all visible windows."    "Go to the end of the buffer in all visible windows."
128    (interactive "P")    (interactive "P")
129    (let ((num-windows (count-windows))    (let ((num-windows (count-windows))
130                  (count 1))          (count 1))
131      (when (> num-windows 1)      (when (> num-windows 1)
132            (other-window 1)        (other-window 1)
133            (while (< count num-windows)        (while (< count num-windows)
134                  (call-interactively 'end-of-buffer)          (call-interactively 'end-of-buffer)
135                  (other-window 1)          (other-window 1)
136                  (setq count (1+ count))))))          (setq count (1+ count))))))
137    
138    
139  (defun scroll-all-check-to-scroll ()  (defun scroll-all-check-to-scroll ()
140    "Check `this-command' to see if a scroll is to be done."    "Check `this-command' to see if a scroll is to be done."
141    (cond    (cond ((eq this-command 'next-line)
142     ((eq this-command 'next-line)           (call-interactively 'scroll-all-scroll-down-all))
143          (call-interactively 'scroll-all-scroll-down-all))          ((eq this-command 'previous-line)
144     ((eq this-command 'previous-line)           (call-interactively 'scroll-all-scroll-up-all))
145          (call-interactively 'scroll-all-scroll-up-all))          ((eq this-command 'scroll-up)
146     ((eq this-command 'scroll-up)           (call-interactively 'scroll-all-page-down-all))
147          (call-interactively 'scroll-all-page-down-all))          ((eq this-command 'scroll-down)
148     ((eq this-command 'scroll-down)           (call-interactively 'scroll-all-page-up-all))
149          (call-interactively 'scroll-all-page-up-all))          ((eq this-command 'beginning-of-buffer)
150     ((eq this-command 'beginning-of-buffer)           (call-interactively 'scroll-all-beginning-of-buffer-all))
151          (call-interactively 'scroll-all-beginning-of-buffer-all))          ((eq this-command 'end-of-buffer)
152     ((eq this-command 'end-of-buffer)           (call-interactively 'scroll-all-end-of-buffer-all))))
         (call-interactively 'scroll-all-end-of-buffer-all))))  
153    
154    
155  ;;;###autoload  ;;;###autoload

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26