+2013-02-28 Juri Linkov <juri@jurta.org>
+
+ * dired-aux.el (dired-diff): If file at point is a backup file,
+ use its original as the default value, and reverse the order
+ of arguments to the `diff' call. Doc fix. (Bug#13772)
+
2013-02-28 Michael Albinus <michael.albinus@gmx.de>
* net/tramp-adb.el (tramp-adb-sdk-dir): Remove. Replaced by ...
(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
+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.)
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 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))
(equal (expand-file-name current file)
(expand-file-name current))))
(error "Attempt to compare the file to itself"))
- (diff file current switches)))
+ (if (and (backup-file-name-p current)
+ (equal file (file-name-sans-versions current)))
+ (diff current file switches)
+ (diff file current switches))))
;;;###autoload
(defun dired-backup-diff (&optional switches)
;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command
;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown
;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff
-;;;;;; dired-diff) "dired-aux" "dired-aux.el" "066bb17769887a7fbc0490003f59e4b3")
+;;;;;; dired-diff) "dired-aux" "dired-aux.el" "d6a694b6d13fa948465fde52a9ffb3ba")
;;; Generated autoloads from dired-aux.el
(autoload 'dired-diff "dired-aux" "\
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
+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.)