Subject: bug#9246: Scrolling bug with word-wrap in emacs -nw

From: Eli Zaretskii <[email-masked]>
Date: Fri, 30 Dec 2011 11:34:23 +0200

> From: Antoine Levitt <[email-masked]>
> Cc: [email-masked],  [email-masked]
> 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.

> >> 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