diff options
author | Eli Zaretskii <eliz@gnu.org> | 2001-10-19 07:23:53 +0000 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2001-10-19 07:23:53 +0000 |
commit | aa44b9c907042ef6c26e3c6571e2d79e7d2e28de (patch) | |
tree | 7a46aa20ec542a5470ab3efc060a695e332bf10e | |
parent | 93bc6c4e678e32959840fc711b2a933afb459d67 (diff) | |
download | emacs-aa44b9c907042ef6c26e3c6571e2d79e7d2e28de.tar.gz |
(scroll-bar-toolkit-scroll): Don't ring the bell
when we hit the beginning or the end of the buffer. Instead, just
print a message and do nothing.
-rw-r--r-- | lisp/scroll-bar.el | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el index 493a271cf23..29ad9a70dab 100644 --- a/lisp/scroll-bar.el +++ b/lisp/scroll-bar.el @@ -312,9 +312,23 @@ EVENT should be a scroll bar click." ((< (car portion-whole) 0) -1) (t 1))))) ((eq part 'up) - (scroll-up -1)) + ;; Avoid ringing the bell when at beginning of + ;; buffer, since that causes redisplay to bitch + ;; endlessly when visible-bell is in effect and + ;; the toolkit sends us many scroll-bar clicks one + ;; after the other. + (if (= 0 (save-excursion + (goto-char (window-start)) + (forward-line -1))) + (scroll-up -1) + (message "Beginning of buffer"))) ((eq part 'down) - (scroll-up 1)) + ;; Avoid ringing the bell if already at end of + ;; buffer; see the commentary above for the + ;; reasons. + (if (= 0 (save-excursion (forward-line 2))) + (scroll-up 1) + (message "End of buffer"))) ((eq part 'top) (set-window-start window (point-min))) ((eq part 'bottom) |