[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (Not) scrolling past the end of a buffer
From: |
Stefan Monnier |
Subject: |
Re: (Not) scrolling past the end of a buffer |
Date: |
Tue, 23 Oct 2012 12:25:43 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) |
> (when (and window-bottom-mode
> (equal (point-max)
> (window-end nil t)))
> (save-excursion
> (goto-char (point-max))
> (recenter -1)))
I guess it would be useful for window-end (or some other function) to
return not just `point-max' when the EOB is displayed, but additionally
indicate where that EOB is displayed (so you can avoid calling
`recenter' if EOB is already at the bottom).
> My problem is that I do not have a place where I can actually put this.
Yup. I think a good place would be a new `after-redisplay-functions'.
Those functions would be called with one argument (the redisplayed
window) right after rebuilding the glyph matrix of a window (and only
if that matrix has changed).
I believe this hook shouldn't be too difficult to add.
A related hook would be `before-redisplay-functions' which I'd also like
to see added. This one is a bit trickier, because we don't want to call
it for every existing window, but only for those which actually require
a redisplay. I would *really* like to see such a hook (reveal-mode
could use it, the region-highlighting code could use it).
Stefan