[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Use cases for post-redisplay hooks
From: |
Keith David Bershatsky |
Subject: |
Re: Use cases for post-redisplay hooks |
Date: |
Mon, 04 Jul 2016 14:42:46 -0700 |
I am using a slightly modified version of Emacs that has what I call a
`window-start-end-hook`, which lets me draw overlays on just the visible window
every command loop. I needs more work, but that is the general idea of the
modification.
There are certain movements of point that are not covered by the
`window-scroll-functions` hook, so that hook cannot be used reliably for the
above-mentioned purpose. And, the hook *may* run more than once each command
loop, leading to potentially wasted time spent running an overlay function that
will need to run again anyway before the display cycle finishes.
The main concern I had regarding a `post-redisplay-hook` would be that users
would add Lisp code to the hook that alters `window-start` and `window-end`,
and I felt that an additional check was needed before redisplay finishes to
make sure that things are where they should be -- e.g., the cursor location.
The key ingredient (for me, at least) would be that the `post-redisplay-hook`
should provide guaranteed correct values for `window-start` and `window-end`.
Thanks,
Keith