Mercurial > emacs
changeset 46729:348e184769b0
(scroll-all-mode): Handle numeric arg. Use `if' instead of `cond'.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Mon, 29 Jul 2002 13:07:23 +0000 |
parents | bd4c1ae5d8e7 |
children | 174c8dfdda14 |
files | lisp/scroll-all.el |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/scroll-all.el Mon Jul 29 05:11:40 2002 +0000 +++ b/lisp/scroll-all.el Mon Jul 29 13:07:23 2002 +0000 @@ -125,12 +125,12 @@ (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)