GNU bug report logs - #13772
24.3.50; dired-diff does not replace dired-backup-diff

Previous Next

Package: emacs;

Reported by: rms <at> gnu.org

Date: Wed, 20 Feb 2013 21:38:02 UTC

Severity: minor

Found in version 24.3.50

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 13772 in the body.
You can then email your comments to 13772 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#13772; Package emacs. (Wed, 20 Feb 2013 21:38:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to rms <at> gnu.org:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 20 Feb 2013 21:38:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; dired-diff does not replace dired-backup-diff
Date: Wed, 20 Feb 2013 16:35:52 -0500
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 <at> 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





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13772; Package emacs. (Thu, 28 Feb 2013 00:18:02 GMT) Full text and rfc822 format available.

Message #8 received at 13772 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Richard Stallman <rms <at> gnu.org>
Cc: 13772 <at> debbugs.gnu.org
Subject: Re: bug#13772: 24.3.50; dired-diff does not replace dired-backup-diff
Date: Thu, 28 Feb 2013 01:57:50 +0200
> 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)




bug closed, send any further explanations to 13772 <at> debbugs.gnu.org and rms <at> gnu.org Request was from Juri Linkov <juri <at> jurta.org> to control <at> debbugs.gnu.org. (Thu, 28 Feb 2013 21:55:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 29 Mar 2013 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 39 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.