ediff-revision drives me nuts - I keep editing the latest revision

Skip Montanaro skip at pobox.com
Thu Mar 22 07:45:07 EDT 2007


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 at 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




More information about the XEmacs-Beta mailing list