I don't think this is the right solution.
It is the job of the job of the vc package to make those buffers read-only
(who would want to modify an old version? At least, this should be made
somewhat difficult.)
This is what cvs does, and this is what vc should do as well.
I use the vc mode stuff with CVS inside XEmacs all the time. I
typically
compare the current file with the latest revision using ediff-revision.
When you quit it leaves point in the 'a' window. I understand the
consistency in the various ediff commands all operating that way, but I
can't tell you how many times I have failed to remember to change buffers
after a comparision and merrily began editing the file ediff-revision
checked out of CVS.
I think it would be extremely helpful if ediff-revision always made the 'a'
buffer read-only to avoid this problem. In fact, if the user asks to
compare two different versions from the repository, I think both buffers
should be made read-only.
I modified ediff-vc-internal in my init.el file. This patch seems to do
what I want:
*** /tmp/skipm/ediff-vers.el Tue Mar 20 15:39:14 2007
--- /tmp/skipm/init.el Tue Mar 20 15:39:14 2007
***************
*** 11,22 ****
(save-excursion
(vc-version-other-window rev1)
(setq rev1buf (current-buffer)
! file1 (buffer-file-name)))
(save-excursion
(or (string= rev2 "") ; use current buffer
(vc-version-other-window rev2))
(setq rev2buf (current-buffer)
! file2 (buffer-file-name)))
(setq startup-hooks
(cons `(lambda ()
(delete-file ,file1)
--- 11,25 ----
(save-excursion
(vc-version-other-window rev1)
(setq rev1buf (current-buffer)
! file1 (buffer-file-name))
! (toggle-read-only))
(save-excursion
(or (string= rev2 "") ; use current buffer
(vc-version-other-window rev2))
(setq rev2buf (current-buffer)
! file2 (buffer-file-name))
! (and (not (string= rev2 ""))
! (toggle-read-only)))
(setq startup-hooks
(cons `(lambda ()
(delete-file ,file1)
--
Skip Montanaro - skip(a)pobox.com -
http://www.webfast.com/~skip/
"The hippies and the hipsters did some great stuff in the sixties,
but the geeks pulled their weight too." -- Billy Bragg
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta