>>>> Aidan wrote:
Aidan> Yes, exactly. save-excursion is the normal way to switch to
Aidan> another buffer temporarily, and it switches the buffer back on
Aidan> error; the pre-idle-hook functions don’t call it, because they
Aidan> need to be fast (they’re called very, very frequently) and
Aidan> save-excursion involves allocating memory and is generally not
Aidan> fast.
So I wrapped the two hooks in pre-idle-hook with a check-buffer-thing
like this:
(defun my-font-lock-pre-idle-hook ()
(let ((buf (current-buffer)))
(font-lock-pre-idle-hook)
(if (not (eq buf (current-buffer)))
(message "Wrong buffer back from font-lock-pre-idle-hook"))))
(defun my-lazy-lock-pre-idle-fontify-windows ()
(let ((buf (current-buffer)))
(lazy-lock-pre-idle-fontify-windows)
(if (not (eq buf (current-buffer)))
(message "Wrong buffer back from lazy-lock-pre-idle-fontify-windows"))))
And my message-buffer is now filled with "Wrong buffer back from
lazy-lock-pre-idle-fontify-windows" lines. So the problem is within
lazy-lock?
Yours
--
%% Mats