From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Charles Rich Newsgroups: gmane.emacs.bugs Subject: Bug in ediff-revision Date: Fri, 17 Jan 2003 14:25:19 -0500 Sender: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <200301171925.h0HJPJj29681@tobi.merl.com> NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1042832134 3471 80.91.224.249 (17 Jan 2003 19:35:34 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 17 Jan 2003 19:35:34 +0000 (UTC) Cc: rich@merl.com Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18ZcH5-0000tX-00 for ; Fri, 17 Jan 2003 20:35:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18ZcCp-0005sD-09 for gnu-bug-gnu-emacs@m.gmane.org; Fri, 17 Jan 2003 14:31:07 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18ZcAP-0004fr-00 for bug-gnu-emacs@gnu.org; Fri, 17 Jan 2003 14:28:37 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18ZcA4-0004Rn-00 for bug-gnu-emacs@gnu.org; Fri, 17 Jan 2003 14:28:17 -0500 Original-Received: from cambridge.merl.com ([137.203.190.1]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18Zc7K-0002hG-00 for bug-gnu-emacs@gnu.org; Fri, 17 Jan 2003 14:25:26 -0500 Original-Received: from tobi.merl.com (tobi.merl.com [137.203.134.7]) by cambridge.merl.com (8.11.6/8.11.2) with ESMTP id h0HJPLw25970; Fri, 17 Jan 2003 14:25:21 -0500 Original-Received: from UDON.merl.com (udon.merl.com [137.203.130.74]) by tobi.merl.com (8.11.6/8.11.1) with ESMTP id h0HJPJj29681; Fri, 17 Jan 2003 14:25:19 -0500 Original-To: bug-gnu-emacs@gnu.org Original-cc: kifer@cs.sunysb.edu X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:4236 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:4236 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