From: Deniz Dogan <deniz@dogan.se>
To: emacs-devel@gnu.org
Subject: Re: Emacs scrolling past the end of buffer
Date: Sun, 12 Feb 2012 17:37:08 +0100 [thread overview]
Message-ID: <4F37EAB4.7050809@dogan.se> (raw)
In-Reply-To: <87wr7we2xp.fsf_-_@gmail.com>
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.
next prev parent reply other threads:[~2012-02-12 16:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-08 21:21 New hook for ERC Deniz Dogan
2012-02-08 22:23 ` Antoine Levitt
2012-02-08 23:32 ` Deniz Dogan
2012-02-09 10:06 ` Emacs scrolling past the end of buffer (was: New hook for ERC) Antoine Levitt
2012-02-09 12:01 ` Emacs scrolling past the end of buffer Deniz Dogan
2012-02-12 16:37 ` Deniz Dogan [this message]
2012-02-12 16:45 ` Eli Zaretskii
2012-02-12 19:52 ` Deniz Dogan
2012-02-12 21:11 ` Eli Zaretskii
2012-02-09 21:29 ` New hook for ERC Lars Ingebrigtsen
2012-02-09 22:41 ` Antoine Levitt
2012-02-08 23:53 ` Johan Bockgård
2012-02-08 23:56 ` Deniz Dogan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F37EAB4.7050809@dogan.se \
--to=deniz@dogan.se \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.