emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs scrolling past the end of buffer


From: Deniz Dogan
Subject: Re: Emacs scrolling past the end of buffer
Date: Sun, 12 Feb 2012 17:37:08 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20120129 Thunderbird/10.0

On 2012-02-09 11:06, Antoine Levitt wrote:
09/02/12 00:32, Deniz Dogan
On 2012-02-08 23:23, Antoine Levitt wrote:
08/02/12 22:21, Deniz Dogan
Hi,

I've been trying to "fix" the behavior of ERC's scroll-to-bottom
module by hooking into erc-insert-post-hook.  I thought that the state
when that hook is executed would be that point is back in the input
area, but it does not seem like it.

Hi,

What's your plan for scroll-to-bottom in ERC? Why do you need this hook
in addition to the existing one? scroll-to-bottom in its current state
is clearly suboptimal, and it has a pretty excessive CPU consumption
when repeating characters.


I don't really have a fully thought-out plan yet, but I believe the
new hook is necessary, because the other hooks are run when the point
has moved away from its original position.  At least I couldn't figure
out how to write code that worked with those hooks.

Having looked at the code for scroll-to-bottom just now, I see that it
uses post-command-hook, which is obviously not an acceptable solution
for the reason that you mention.

A good compromise, in my opinion, would be to basically _not_ "scroll
to bottom" on every single character insertion.  With the addition of
the post-display hook, when the user hits RET, the message will be
sent, ERC will display that message, the new hook will run, and it
will be recentered to the bottom again.  This method is something I've
personally used in rcirc for quite some time and I'm very happy with
it.

But then it sometimes happen that you see past the end of the buffer
when scrolling (the horror!). I'd rather have excessive CPU consumption.


What if we combine this with a function in `window-scroll-functions'? I haven't thought it through completely, but my gut feeling says it should be possible.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]