diff options
| author | Richard M. Stallman | 1997-04-29 21:06:16 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-04-29 21:06:16 +0000 |
| commit | beaf629ddbb4f798814d02ba6c91f514669d848d (patch) | |
| tree | bcd292708cd261a86b126199d5f751c86ba011c0 | |
| parent | 11a66c13af58034a6503b3c390f9108faa1afbae (diff) | |
| download | emacs-beaf629ddbb4f798814d02ba6c91f514669d848d.tar.gz emacs-beaf629ddbb4f798814d02ba6c91f514669d848d.zip | |
Renamed from scroll-lock.el.
All functions renamed.
(scroll-all-mode): Variable renamed from is-scroll-lock.
| -rw-r--r-- | lisp/scroll-all.el | 65 |
1 files changed, 28 insertions, 37 deletions
diff --git a/lisp/scroll-all.el b/lisp/scroll-all.el index 3359f896602..723f19e4af7 100644 --- a/lisp/scroll-all.el +++ b/lisp/scroll-all.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;; scroll-lock.el -- scroll-locking minor mode | 1 | ;; scroll-all.el -- scroll all buffers together minor mode |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1997 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1997 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -31,32 +31,23 @@ | |||
| 31 | ;; screen-at-a-time scrolling, and doesn't remap any of the keyboard | 31 | ;; screen-at-a-time scrolling, and doesn't remap any of the keyboard |
| 32 | ;; commands to do it. | 32 | ;; commands to do it. |
| 33 | 33 | ||
| 34 | ;; You can disable autoloading of this package by placing | 34 | ;; You can enable and disable this mode with the 'scroll-all-mode' command. |
| 35 | ;; (setq crisp-load-scroll-lock nil) in your .emacs before loading | ||
| 36 | ;; the crisp package. If you want to use this package by itself, | ||
| 37 | ;; you can enable it by placing the following in your .emacs: | ||
| 38 | |||
| 39 | ;; (require 'scroll-lock) | ||
| 40 | |||
| 41 | ;; In the first (autoloaded) case, meta-f1 is bound to the command to | ||
| 42 | ;; toggle the scroll-lock mode. In the second (non-autoloaded) case, | ||
| 43 | ;; you can enable and disable it with the 'scroll-lock-mode' command. | ||
| 44 | 35 | ||
| 45 | ;; Suggestions/ideas from: | 36 | ;; Suggestions/ideas from: |
| 46 | ;; Rick Macdonald <rickm@vsl.com> | 37 | ;; Rick Macdonald <rickm@vsl.com> |
| 47 | ;; Anders Lindgren <andersl@csd.uu.se> | 38 | ;; Anders Lindgren <andersl@csd.uu.se> |
| 48 | 39 | ||
| 49 | (defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version)) | 40 | (defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version)) |
| 50 | (defvar is-scroll-locked nil | 41 | (defvar scroll-all-mode nil |
| 51 | "Track status of scroll locking.") | 42 | "Track status of scroll locking.") |
| 52 | (if running-xemacs | 43 | (if running-xemacs |
| 53 | (add-minor-mode 'is-scroll-locked " *SL*") | 44 | (add-minor-mode 'scroll-all-mode " *SL*") |
| 54 | (or (assq 'is-scroll-locked-mode minor-mode-alist) | 45 | (or (assq 'scroll-all-mode-mode minor-mode-alist) |
| 55 | (setq minor-mode-alist | 46 | (setq minor-mode-alist |
| 56 | (cons '(is-scroll-locked-mode " *SL*") minor-mode-alist)))) | 47 | (cons '(scroll-all-mode-mode " *SL*") minor-mode-alist)))) |
| 57 | 48 | ||
| 58 | (defun scroll-lock-scroll-down-all (arg) | 49 | (defun scroll-all-scroll-down-all (arg) |
| 59 | "Scroll-down all visible windows." | 50 | "Scroll down all visible windows." |
| 60 | (interactive "P") | 51 | (interactive "P") |
| 61 | (let ((num-windows (count-windows)) | 52 | (let ((num-windows (count-windows)) |
| 62 | (count 1)) | 53 | (count 1)) |
| @@ -68,8 +59,8 @@ | |||
| 68 | (other-window 1) | 59 | (other-window 1) |
| 69 | (setq count (1+ count))))))) | 60 | (setq count (1+ count))))))) |
| 70 | 61 | ||
| 71 | (defun scroll-lock-scroll-up-all (arg) | 62 | (defun scroll-all-scroll-up-all (arg) |
| 72 | "Scroll-up all visible windows." | 63 | "Scroll up all visible windows." |
| 73 | (interactive "P") | 64 | (interactive "P") |
| 74 | (let ((num-windows (count-windows)) | 65 | (let ((num-windows (count-windows)) |
| 75 | (count 1)) | 66 | (count 1)) |
| @@ -81,8 +72,8 @@ | |||
| 81 | (other-window 1) | 72 | (other-window 1) |
| 82 | (setq count (1+ count))))))) | 73 | (setq count (1+ count))))))) |
| 83 | 74 | ||
| 84 | (defun scroll-lock-page-down-all (arg) | 75 | (defun scroll-all-page-down-all (arg) |
| 85 | "Page-down all visible windows." | 76 | "Page down in all visible windows." |
| 86 | (interactive "P") | 77 | (interactive "P") |
| 87 | (let ((num-windows (count-windows)) | 78 | (let ((num-windows (count-windows)) |
| 88 | (count 1)) | 79 | (count 1)) |
| @@ -93,8 +84,8 @@ | |||
| 93 | (other-window 1) | 84 | (other-window 1) |
| 94 | (setq count (1+ count))))))) | 85 | (setq count (1+ count))))))) |
| 95 | 86 | ||
| 96 | (defun scroll-lock-page-up-all (arg) | 87 | (defun scroll-all-page-up-all (arg) |
| 97 | "Page-up all visible windows." | 88 | "Page up in all visible windows." |
| 98 | (interactive "P") | 89 | (interactive "P") |
| 99 | (let ((num-windows (count-windows)) | 90 | (let ((num-windows (count-windows)) |
| 100 | (count 1)) | 91 | (count 1)) |
| @@ -106,28 +97,28 @@ | |||
| 106 | (setq count (1+ count))))))) | 97 | (setq count (1+ count))))))) |
| 107 | 98 | ||
| 108 | 99 | ||
| 109 | (defun scroll-lock-check-to-scroll () | 100 | (defun scroll-all-check-to-scroll () |
| 110 | "Check last-command to see if a scroll was done." | 101 | "Check `last-command' to see if a scroll was done." |
| 111 | (if (eq this-command 'next-line) | 102 | (if (eq this-command 'next-line) |
| 112 | (call-interactively 'scroll-lock-scroll-down-all)) | 103 | (call-interactively 'scroll-all-scroll-down-all)) |
| 113 | (if (eq this-command 'previous-line) | 104 | (if (eq this-command 'previous-line) |
| 114 | (call-interactively 'scroll-lock-scroll-up-all)) | 105 | (call-interactively 'scroll-all-scroll-up-all)) |
| 115 | (if (eq this-command 'fkey-scroll-up) | 106 | (if (eq this-command 'fkey-scroll-up) |
| 116 | (call-interactively 'scroll-lock-page-down-all)) | 107 | (call-interactively 'scroll-all-page-down-all)) |
| 117 | (if (eq this-command 'fkey-scroll-down) | 108 | (if (eq this-command 'fkey-scroll-down) |
| 118 | (call-interactively 'scroll-lock-page-up-all))) | 109 | (call-interactively 'scroll-all-page-up-all))) |
| 119 | 110 | ||
| 120 | 111 | ||
| 121 | (defun scroll-lock-mode (arg) | 112 | (defun scroll-all-mode (arg) |
| 122 | "Toggle scroll-lock minor mode." | 113 | "Toggle Scroll-All minor mode." |
| 123 | (interactive "P") | 114 | (interactive "P") |
| 124 | (setq is-scroll-locked (not is-scroll-locked)) | 115 | (setq scroll-all-mode (not scroll-all-mode)) |
| 125 | (cond | 116 | (cond |
| 126 | ((eq is-scroll-locked 't) | 117 | ((eq scroll-all-mode 't) |
| 127 | (add-hook 'post-command-hook 'scroll-lock-check-to-scroll)) | 118 | (add-hook 'post-command-hook 'scroll-all-check-to-scroll)) |
| 128 | ((eq is-scroll-locked 'nil) | 119 | ((eq scroll-all-mode 'nil) |
| 129 | (remove-hook 'post-command-hook 'scroll-lock-check-to-scroll)))) | 120 | (remove-hook 'post-command-hook 'scroll-all-check-to-scroll)))) |
| 130 | 121 | ||
| 131 | (provide 'scroll-lock) | 122 | (provide 'scroll-all) |
| 132 | 123 | ||
| 133 | ;; scroll-all.el ends here | 124 | ;; scroll-all.el ends here |