Both for RCS and CVS I use vc.el to perform version-control from
within source buffers directly.
Whenever I RCS-checkin or CVS-commit a file using
C-x v v (vc-next-action)
I loose fontification of that buffer.
This also happens for
C-x v u (vc-revert-buffer)
I have
(emacs-version)
"XEmacs 21.1 (patch 4) \"Arches\" [Lucid] (i386-pc-win32) of Thu Jul
08 1999 on ZJ75T"
and
vc 1.18 Version Control for Free systems.
I tracked this down to a specific argument `vc-revert-buffer1'
supplies in its call to `revert-buffer'. It is true that it preserves
minor modes (like footnote-mode) that way, but fontification is lost,
although the modeline still says font-lock-mode is on. Only newly
entered text is fontified.
I tried calling
(revert-buffer arg no-confirm nil)
instead and this restores the fontification but looses the minor mode.
To me this still seems the better alternative.
---------------------------------
What is the correct fix for this?
---------------------------------
Thanks,
Adrian
(defun vc-revert-buffer1 (&optional arg no-confirm)
;; Revert buffer, try to keep point and mark where user expects them in spite
;; of changes because of expanded version-control key words.
;; This is quite important since otherwise typeahead won't work as expected.
(interactive "P")
(widen)
(let ((context (vc-buffer-context)))
;; t means don't call normal-mode; that's to preserve various minor modes.
(revert-buffer arg no-confirm t)
(vc-restore-buffer-context context)))
--
NON DISPERDERE IL VETRO NELL'AMBIENTE