From unknown Fri Aug 15 16:58:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13772: 24.3.50; dired-diff does not replace dired-backup-diff Resent-From: Richard Stallman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Feb 2013 21:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13772 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 13772@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Reply-To: rms@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.13613962398302 (code B ref -1); Wed, 20 Feb 2013 21:38:02 +0000 Received: (at submit) by debbugs.gnu.org; 20 Feb 2013 21:37:19 +0000 Received: from localhost ([127.0.0.1]:40639 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U8HLq-00029p-Cy for submit@debbugs.gnu.org; Wed, 20 Feb 2013 16:37:19 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34622) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U8HLn-00029e-Tc for submit@debbugs.gnu.org; Wed, 20 Feb 2013 16:37:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8HKX-0004di-LU for submit@debbugs.gnu.org; Wed, 20 Feb 2013 16:36:02 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-102.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:54391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8HKX-0004de-Ik for submit@debbugs.gnu.org; Wed, 20 Feb 2013 16:35:57 -0500 Received: from eggs.gnu.org ([208.118.235.92]:45946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8HKV-0003kp-2G for bug-gnu-emacs@gnu.org; Wed, 20 Feb 2013 16:35:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8HKT-0004cy-CG for bug-gnu-emacs@gnu.org; Wed, 20 Feb 2013 16:35:54 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51309) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8HKT-0004cu-8M for bug-gnu-emacs@gnu.org; Wed, 20 Feb 2013 16:35:53 -0500 Received: from rms by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1U8HKS-00048P-FY; Wed, 20 Feb 2013 16:35:52 -0500 Date: Wed, 20 Feb 2013 16:35:52 -0500 Message-Id: Content-Type: text/plain; charset=ISO-8859-15 From: Richard Stallman X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -7.5 (-------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -7.5 (-------) 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. In GNU Emacs 24.3.50.4 (mips64el-unknown-linux-gnu, GTK+ Version 2.20.1) of 2013-02-02 on chiefs-gnewsense Bzr revision: 111655 christopher@ch.ristopher.com-20130201171924-mqojkjw974mj7ndq System Description: Debian GNU/Linux 6.0.6 (squeeze) Configured using: `configure CFLAGS=-O0 -g --with-gif=no --with-tiff=no --no-create --no-recursion' Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Diff Minor modes in effect: diff-auto-refine-mode: t shell-dirtrack-mode: t gpm-mouse-mode: t tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t abbrev-mode: t Recent input: C-p C-x 4 b r f c 8 TAB RET C-s # i f SPC 0 C-s C-s C-s C-a C-s C-s C-s C-s C-s C-a C-k C-k C-n C-k C-k C-x o ESC v ESC v ESC v C-v C-n C-n C-n C-@ C-u C-n ESC w C-x o C-n C-n C-n C-y C-@ C-g C-u C-p C-d C-d C-n C-d C-d C-n C-d C-d C-n C-d C-d C-n C-@ C-u C-n C-n C-n C-n C-n C-n C-n C-w C-x o C-v C-v ESC v C-x o C-x 1 C-v C-u C-p C-u C-n C-n C-n C-k C-k C-p C-p C-p C-e SPC { C-a C-n C-n C-n C-@ C-u C-n C-u C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-u 2 C-x TAB C-o } ESC C-p ESC C-n SPC e l s e SPC { RET TAB b r e a k ; RET } C-x C-s C-x b m b o x . c RET C-x b RET C-x b m a i r TAB TAB - TAB RET = C-g C-n C-p = C-g = ESC n . TAB 1 TAB RET C-x 0 C-v C-u C-v C-u C-v C-u C-v C-u C-v C-u C-v C-u C-v C-u C-v C-u C-v C-u C-v C-u C-v C-u C-v C-x b RET C-x b r f c TAB RET C-n C-n C-a C-k C-k C-v C-x C-s C-x b o u t g TAB RET g C-x b f DEL r f c TAB RET C-x b m a i r TAB - TAB RET C-n = RET = ESC n DEL DEL DEL DEL RET C-x 0 C-v ESC x r e p o r t SPC e m a v s DEL DEL s SPC DEL c s SPC b u g RET Recent messages: Mark activated Mark set Saving file /home/rms/mairix-0.23/rfc822.c... Wrote /home/rms/mairix-0.23/rfc822.c Making completion list... Quit [2 times] Auto-saving...done Saving file /home/rms/mairix-0.23/rfc822.c... Wrote /home/rms/mairix-0.23/rfc822.c dired-diff: Attempt to compare the file to itself Load-path shadows: None found. Features: (shadow emacsbug bug-reference diff cc-langs cl cl-lib cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs dired-aux mule-util cal-move cal-menu calendar cal-loaddefs log-edit pcvs-util add-log diff-mode easy-mmode vc vc-dispatcher rmailsum rect parse-time vc-cvs sgml-mode gnus-util mailcap find-func vc-bzr jka-compr rmailout dabbrev shell pcomplete grep compile comint ansi-color ring misearch multi-isearch quail help-mode mailalias qp rmailmm message sendmail format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mailabbrev gmm-utils mailheader mail-parse rfc2231 dired t-mouse time-date rmailedit rmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils paren cus-start cus-load nadvice advice help-fns tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) -- Dr Richard Stallman President, Free Software Foundation 51 Franklin St Boston MA 02110 USA www.fsf.org www.gnu.org Skype: No way! That's nonfree (freedom-denying) software. Use Ekiga or an ordinary phone call From unknown Fri Aug 15 16:58:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13772: 24.3.50; dired-diff does not replace dired-backup-diff 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: To: Richard Stallman Cc: 13772@debbugs.gnu.org Received: via spool by 13772-submit@debbugs.gnu.org id=B13772.136201062311860 (code B ref 13772); Thu, 28 Feb 2013 00:18:02 +0000 Received: (at 13772) by debbugs.gnu.org; 28 Feb 2013 00:17:03 +0000 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 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 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) From: Juri Linkov Organization: JURTA References: Date: Thu, 28 Feb 2013 01:57:50 +0200 In-Reply-To: (Richard Stallman's message of "Wed, 20 Feb 2013 16:35:52 -0500") Message-ID: <87k3pts3ro.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > 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) From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 28 16:54:36 2013 Received: (at control) by debbugs.gnu.org; 28 Feb 2013 21:54:36 +0000 Received: from localhost ([127.0.0.1]:56783 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UBBQy-0001wl-41 for submit@debbugs.gnu.org; Thu, 28 Feb 2013 16:54:36 -0500 Received: from ps18281.dreamhost.com ([69.163.218.105]:40092 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UBBQw-0001we-SZ for control@debbugs.gnu.org; Thu, 28 Feb 2013 16:54:35 -0500 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 28E47258B92901 for ; Thu, 28 Feb 2013 13:52:34 -0800 (PST) From: Juri Linkov To: control@debbugs.gnu.org Subject: Re: bug#13772: 24.3.50; dired-diff does not replace dired-backup-diff Organization: JURTA References: <87k3pts3ro.fsf@mail.jurta.org> Date: Thu, 28 Feb 2013 23:51:40 +0200 In-Reply-To: <87k3pts3ro.fsf@mail.jurta.org> (Juri Linkov's message of "Thu, 28 Feb 2013 01:57:50 +0200") Message-ID: <8738wggl8s.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.8 (/) close 13772 thanks