diff options
author | Glenn Morris <rgm@gnu.org> | 2002-07-29 13:08:44 +0000 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2002-07-29 13:08:44 +0000 |
commit | 091b5fdbd802f60f2442dce3f9f85b8e81c948de (patch) | |
tree | d39d1ce8317e2c96061e25424abe043211c30da7 /lisp/scroll-all.el | |
parent | 2653e2a77fcfcbf320fae7dd17b26d870d8d6016 (diff) | |
download | emacs-091b5fdbd802f60f2442dce3f9f85b8e81c948de.tar.gz |
(scroll-all-mode): Handle numeric arg. Use `if' instead of `cond'.
Diffstat (limited to 'lisp/scroll-all.el')
-rw-r--r-- | lisp/scroll-all.el | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/scroll-all.el b/lisp/scroll-all.el index 4548f954a7a..9092cfa7525 100644 --- a/lisp/scroll-all.el +++ b/lisp/scroll-all.el @@ -125,12 +125,12 @@ use either \\[customize] or the function `scroll-all-mode'." (defun scroll-all-mode (arg) "Toggle Scroll-All minor mode." (interactive "P") - (setq scroll-all-mode (not scroll-all-mode)) - (cond - ((eq scroll-all-mode 't) - (add-hook 'post-command-hook 'scroll-all-check-to-scroll)) - ((eq scroll-all-mode 'nil) - (remove-hook 'post-command-hook 'scroll-all-check-to-scroll)))) + (setq scroll-all-mode + (if (null arg) (not scroll-all-mode) + (> (prefix-numeric-value arg) 0))) + (if scroll-all-mode + (add-hook 'post-command-hook 'scroll-all-check-to-scroll) + (remove-hook 'post-command-hook 'scroll-all-check-to-scroll))) (provide 'scroll-all) |