From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#13772: 24.3.50; dired-diff does not replace dired-backup-diff Date: Thu, 28 Feb 2013 01:57:50 +0200 Organization: JURTA Message-ID: <87k3pts3ro.fsf@mail.jurta.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1362010579 27537 80.91.229.3 (28 Feb 2013 00:16:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Feb 2013 00:16:19 +0000 (UTC) Cc: 13772@debbugs.gnu.org To: Richard Stallman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 28 01:16:40 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UArAr-00062t-9B for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Feb 2013 01:16:37 +0100 Original-Received: from localhost ([::1]:43784 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UArAW-0007t2-9m for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Feb 2013 19:16:16 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60853) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UArAS-0007rn-BW for bug-gnu-emacs@gnu.org; Wed, 27 Feb 2013 19:16:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UArAQ-0004iy-80 for bug-gnu-emacs@gnu.org; Wed, 27 Feb 2013 19:16:12 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48951) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UArAQ-0004il-3P for bug-gnu-emacs@gnu.org; Wed, 27 Feb 2013 19:16:10 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UArCE-00036p-Us for bug-gnu-emacs@gnu.org; Wed, 27 Feb 2013 19:18:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Feb 2013 00:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13772 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13772-submit@debbugs.gnu.org id=B13772.136201062311860 (code B ref 13772); Thu, 28 Feb 2013 00:18:02 +0000 Original-Received: (at 13772) by debbugs.gnu.org; 28 Feb 2013 00:17:03 +0000 Original-Received: from localhost ([127.0.0.1]:54412 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UArBG-000354-5M for submit@debbugs.gnu.org; Wed, 27 Feb 2013 19:17:02 -0500 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:39670 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UArBB-00034f-Vu for 13772@debbugs.gnu.org; Wed, 27 Feb 2013 19:16:59 -0500 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 7D195258B92903; Wed, 27 Feb 2013 16:15:03 -0800 (PST) In-Reply-To: (Richard Stallman's message of "Wed, 20 Feb 2013 16:35:52 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:71932 Archived-At: > The M-= binding for dired-backup-diff was deleted, > supposedly because dired-diff now replaces it. > However, it does not. If you type it on a backup file, > it does not present the current file as the default argument. > The default argument gives an error. > > And if you specify the current file as the argument, you get a diff > between the right two files, but it is in reverse order. The following patch copies the relevant logic from `diff-backup' to `dired-diff', so that typing it on a backup file should present its original as the default argument and run a diff in correct order. === modified file 'lisp/dired-aux.el' *** lisp/dired-aux.el 2013-01-01 09:11:05 +0000 --- lisp/dired-aux.el 2013-02-27 23:56:03 +0000 *************** (defconst dired-quark-subst-regexp "\\(^ *** 55,61 **** (defun dired-diff (file &optional switches) "Compare file at point with file FILE using `diff'. If called interactively, prompt for FILE. If the file at point ! has a backup file, use that as the default. If the mark is active in Transient Mark mode, use the file at the mark as the default. \(That's the mark set by \\[set-mark-command], not by Dired's \\[dired-mark] command.) --- 55,62 ---- (defun dired-diff (file &optional switches) "Compare file at point with file FILE using `diff'. If called interactively, prompt for FILE. If the file at point ! has a backup file, use that as the default. If the file at point ! is a backup file, use its original. If the mark is active in Transient Mark mode, use the file at the mark as the default. \(That's the mark set by \\[set-mark-command], not by Dired's \\[dired-mark] command.) *************** (defun dired-diff (file &optional switch *** 67,74 **** the string of command switches for the third argument of `diff'." (interactive (let* ((current (dired-get-filename t)) ! ;; Get the latest existing backup file. ! (oldf (diff-latest-backup-file current)) ;; Get the file at the mark. (file-at-mark (if (and transient-mark-mode mark-active) (save-excursion (goto-char (mark t)) --- 68,77 ---- the string of command switches for the third argument of `diff'." (interactive (let* ((current (dired-get-filename t)) ! ;; Get the latest existing backup file or its original. ! (oldf (if (backup-file-name-p current) ! (file-name-sans-versions current) ! (diff-latest-backup-file current))) ;; Get the file at the mark. (file-at-mark (if (and transient-mark-mode mark-active) (save-excursion (goto-char (mark t)) *************** (defun dired-diff (file &optional switch *** 107,113 **** (equal (expand-file-name current file) (expand-file-name current)))) (error "Attempt to compare the file to itself")) ! (diff file current switches))) ;;;###autoload (defun dired-backup-diff (&optional switches) --- 110,119 ---- (equal (expand-file-name current file) (expand-file-name current)))) (error "Attempt to compare the file to itself")) ! (if (and (backup-file-name-p current) ! (not (backup-file-name-p file))) ! (diff current file switches) ! (diff file current switches)))) ;;;###autoload (defun dired-backup-diff (&optional switches)