Subject: bug#16196: 24.3.50; Disable ding when scrolling

From: Jan Djärv <[email-masked]>
Date: Fri, 20 Dec 2013 11:26:18 +0100

Hello. 

20 dec 2013 kl. 09:56 skrev Eli Zaretskii <[email-masked]>:

>> From: Jan Djärv <[email-masked]>
>> Date: Fri, 20 Dec 2013 07:08:37 +0100
>> 
>> I think Emacs should by default not beep at all when scrolling and no movement can be done.
> 
> This could be hard to implement.  Most scrolling commands just examine
> the text around point, and set the window-start for the next
> redisplay, so they don't really know when no movement can be done.
> Thus, the exact conditions for bitching "End of buffer" are not at all
> what you could imagine, and not easily correlated with the situation
> you describe.  For example, the next-line and previous-line commands
> signal these errors when they find they are unable to scroll text,
> something that might be utterly unrelated to hitting end of buffer.

I have in my .emacs:

(setq mwheel-scroll-up-function
     '(lambda (amt)
        (if (< (window-end) (point-max)) (scroll-up amt))))

(setq mwheel-scroll-down-function
     '(lambda (amt)
        (if (> (window-start) (point-min)) (scroll-down amt))))

This does what this bug report talks about, except in the horizontal direction. So it can't be that hard. 

       Jan D. 

> 
>> It should just ignore it and do nothing, like most applications do.
> 
> Well, "do nothing" is something Emacs cannot easily do in this case,
> since the part that "does nothing" is redisplay, which has no idea
> about the scrolling command that just ran.
> 
>> At the very least there should be an option to turn off scrollrelated beeping.
> 
> This should be much easier to implement, although you may be surprised
> to see in how many places we throw that particular error.  (Hint: grep
> the Lisp sources for "'end-of-file".)
> 
> Patches are welcome, as usual.