30/12/11 10:34, Eli Zaretskii >> From: Antoine Levitt >> Cc: riccardi.thomas@gmail.com, 9246@debbugs.gnu.org >> Date: Thu, 29 Dec 2011 23:45:25 +0100 >> >> >> So, should erc-scrollbottom be changed? >> > >> > Definitely. It shouldn't use window-scroll-functions. >> >> So is there a hook it could use? > > How about post-command-hook? > >> Incidentally, this warning doesn't get displayed on C-h v, it might be a >> good idea to move it. > > Patches are welcome. Here's two patches. The first adds the warning from the info file into the variable definition. The second fixes erc-scrollbottom by using post-command-hook instead of window-scroll-functions. Can you merge them? > >> >> Actually, this is a behavior I'd like for emacs as a whole, to make it >> >> behave more like other editors that never display anything past the end >> >> of text. Is there any way to do it, some other variable one could set in >> >> addition to scroll-conservatively? >> > >> > Maybe, I don't know. >> >> If you don't know, it probably means there isn't ;) > > Don't count on that ;-) > >> I tried to hack something together, but I couldn't make it work, because >> I couldn't find an appropriate way to express "if the window is >> displaying stuff past the end of buffer" (using window-end and >> buffer-end does not work, because window-end can never be past >> buffer-end). > > How about this strategy: > > go to window-end > call posn-at-point > compare the row returned by posn-at-point with window-height That works pretty well! (when hooked into post-command-hook) Except that sometimes posn-at-point is nil, presumably because redisplay hasn't taken place yet. It works when I force redisplay, except that of course it's wrong to do that. I couldn't find a post-redisplay-hook, which might be more appropriate. Is there one?