I want to optionally perform some functions on the data in buffer *WL:Message*
right after I access and view it.
For example, when first viewing a new message in the *WL:Message*
buffer via wl-summary-read
or wl-summary-enter-handler
, I'd like to perform the following logic (pseudo-code) ...
Enter the *WL:Message* buffer
IF *WL:Message* buffer contains images
THEN
Scroll down to the first image
Do a (recenter 1) to position this image at the top of the window
ENDIF
I know how to write the elisp code to do all of this. The problem is knowing when to issue this code. I haven't been able to find a hook that runs right as the *WL:Message*
buffer is being displayed.
I tried to use advice around various existing wanderlust wl-summary
and wl-message
functions, but I haven't found a reliable way to do what I want. Sometimes (seemingly at random), the wl-message-buffer
variable is not set, or that buffer's window is not live (it needs to be a live window in order for (recenter 1)
to work).
Does anyone know of the proper place I can insert my code so that it always reliably runs whenever I first view a new message in the *WL:Message*
buffer?
*WL:Message*
buffer, not the emacs*Messages*
buffer. I changed this to be precise ...wl-message-display-internal-hook
? There are too many possibilities that I am not fully aware of that may affect displaying a buffer, so I cannot duplicate your own settings to test it out. The hook is on almost the last line ofwl-message-display-internal
(which gets called near the end ofwl-message-buffer-display
), so it looks promising. I disabled default displaying of buffers in Wanderlust and almost everything isnoselect
(i.e., populated in the background) so that I can display the WL folders and buffers wherever and whenever I choose.wl-summary-down
may also be getting in your way, so you may wish to have a look at that too. Functions like that are what I have removed in my custom version ... See alsowl-message-redisplay-hook
.wl-message-redisplay-hook
will indeed work for me. See my answer, below, for details. I can accept my answer in 22 hours from now, and I then will do so.