I think I found the problem. As it turns out you can easily explore
the phenomenon by creating a dummy function, attaching it to the
font-lock-mode-hook and putting a debug-on-entry breakpoint there.
(defun foo ()
(message "font-lock-mode-hook evaluated"))
(add-hook 'font-lock-mode-hook 'foo)
M-x debug-on-entry foo
Then get a buffer and revert it.
For buffer reversion, I see font-lock being called via
the font-lock-revert-cleanup alias which looks like (from font-lock.el):
;; If the buffer has just been reverted, normally that turns off
;; Font Lock mode. So turn the mode back on if necessary.
(defalias 'font-lock-revert-cleanup 'turn-on-font-lock)
It appears that the comment is no longer operative as I see the buffer
being font-locked when normal-mode is called initially. So this
appears to be a different problem than the one I was originally
thinking of. Could people who are experiencing this problem please
try eliminating the font-lock-revert-cleanup function and see what, if
anything, breaks? Ie. after starting XEmacs and loading
font-lock.elc, evaluate the following in *scratch*:
(defun font-lock-revert-cleanup ())