Adrian Aichner <aichner(a)ecf.teradyne.com> writes in xemacs-beta(a)xemacs.org:
>>>>> "APA" == Adrian Aichner
<aichner(a)ecf.teradyne.com> writes:
APA> Right on:
APA> With an unpatched vc.elc? fontification survives
APA> vc-revert-buffer
APA> when I have this in my .emacs:
APA> (setq font-lock-support-mode 'fast-lock-mode)
Oops, I tested this incorrectly. Fontification is lost for me in
fast-lock-mode too!
Then there must be something else involved.
APA> Fontification is lost when I use any of these:
APA> (setq font-lock-support-mode 'font-lock-mode)
APA> (setq font-lock-support-mode 'lazy-lock-mode)
Oh. The infamous lazy-good-for-nothing-lock-mode. That's a pissing
contest between Ben Wing and Simon Marshall. I very nearly gave up
XEmacs until I learned how to turn it off.
For what it's worth, font-lock-mode works for me. Enabling
lazy-lock-mode and doing a revert-buffer gives me a bomb:
Signaling: (args-out-of-range #<buffer ".emacs"> 1 105913)
lazy-lock-put-text-property(1 105913 fontified nil)
lazy-lock-after-change-function(1 105913 52956)
insert-file-contents-internal("/usr/users/steve/.emacs" t nil nil t undecided
used-codesys)
byte-code("..." [run-hook-with-args insert-file-contents-access-hook filename
visit coding-system-for-read run-hook-with-args-until-success
insert-file-contents-pre-hook find-file-coding-system-for-read-from-filename
buffer-file-coding-system-for-read raw-text coding-system return-val find-coding-system
message "Invalid coding-system (%s), using 'undecided" undecided
insert-file-contents-internal beg end replace used-codesys find-coding-system-magic-cookie
cs] 9)
insert-file-contents("/usr/users/steve/.emacs" t nil nil t)
#<compiled-function (&optional ignore-auto noconfirm preserve-modes)
"...(261)" [revert-buffer-function ignore-auto noconfirm opoint
recent-auto-save-p buffer-auto-save-file-name file-readable-p y-or-n-p "Buffer has
been auto-saved recently. Revert from auto-save file? " auto-save-p buffer-file-name
file-name error "Buffer does not seem to be associated with any file"
buffer-modified-p nil found revert-without-query rx --dolist-temp--42045 string-match t
yes-or-no-p format "Revert buffer from file %s? " run-hooks before-revert-hook
verify-visited-file-modtime buffer-backed-up buffer-undo-list default-value
after-revert-hook local-variable-p local-hook local-hook-p global-hook buffer-read-only
revert-buffer-insert-file-contents-function file-exists-p "File %s no longer
exists!" unlock-buffer insert-file-contents after-find-file preserve-modes
set-default revert-buffer-internal-hook make-local-variable kill-local-variable] 7 853936
(list (not current-prefix-arg))>(t)
call-interactively(revert-buffer)
command-execute(revert-buffer t)
execute-extended-command(nil)
call-interactively(execute-extended-command)
I tested both of those in an XEmacs/Mule by:
xemacs -vanilla
(font-lock-mode)
C-x C-f ~/.emacs
M-x revert-buffer
and
xemacs -vanilla
(add-hook 'font-lock-mode-hook 'turn-on-lazy-lock)
(font-lock-mode)
C-x C-f ~/.emacs
M-x revert-buffer
I have no idea what `font-lock-support-mode' is. It is unbound in
this instance of XEmacs.
APA> For font-lock-mode fontification is lost after `revert-buffer' calls
APA> `insert-file-contents'.
This is still true. Actually it happens when
`insert-file-contents'
calls `insert-file-contents-internal'.
I don't understand yet why insert-file-contents get called twice
for
find-file and for vc-revert-buffer.
This is probably due to coding system detection.
vc-revert-buffer calls insert-file-contents with a t REPLACE
argument.
Right.