* Bug in ediff-revision
@ 2003-01-17 19:25 Charles Rich
0 siblings, 0 replies; only message in thread
From: Charles Rich @ 2003-01-17 19:25 UTC (permalink / raw)
Cc: rich
Regarding ediff-revision in ediff.el:
Between Emacs 20.6 and 21.2.1, the definition of
vc-version-other-window (which is eventually called by ediff-revision)
CHANGED from interpreting an empty string for rev1 as the latest
version (which is what the prompt says--see below) to treating it as
the working-version.
Line added below (with comment) restores the "old" behavior, consistent
with the prompt.
-CR
P.S. One might consider instead changing the prompt for rev1 below to
read "working version", but from my experience using this command a
lot, the "latest version" behavior is much more useful.
(defun ediff-revision (&optional file startup-hooks)
"Run Ediff by comparing versions of a file.
The file is an optional FILE argument or the file visited by the current
buffer. Use `vc.el' or `rcs.el' depending on `ediff-version-control-package'."
;; if buffer is non-nil, use that buffer instead of the current buffer
(interactive "P")
(if (stringp file) (find-file file))
(let (rev1 rev2)
(setq rev1
(read-string
(format "Version 1 to compare (default: %s's latest version): "
(if (stringp file)
(file-name-nondirectory file) "current buffer")))
rev2
(read-string
(format "Version 2 to compare (default: %s): "
(if (stringp file)
(file-name-nondirectory file) "current buffer"))))
(ediff-load-version-control)
;; fix bug noted above
(if (string= rev1 "")
(setq rev1 (vc-latest-version (buffer-file-name))))
(funcall
(intern (format "ediff-%S-internal" ediff-version-control-package))
rev1 rev2 startup-hooks)
))
(defun vc-latest-version (file)
"Return the version level of the latest version of FILE in repository."
(or (vc-file-getprop file 'vc-latest-version)
(cond ((vc-backend file)
(vc-call state file)
(vc-file-getprop file 'vc-latest-version))
(t (error "File %s is not under version control" file)))))
--
Charles Rich, Ph.D. | Mitsubishi Electric Research Laboratories
617-621-7507 phone | 201 Broadway
617-621-7550 fax | Cambridge, MA 02139
rich@merl.com | http://www.merl.com
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-01-17 19:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-17 19:25 Bug in ediff-revision Charles Rich
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).