summaryrefslogtreecommitdiff
path: root/lisp/dired-aux.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1992-07-27 02:56:28 +0000
committerRichard M. Stallman <rms@gnu.org>1992-07-27 02:56:28 +0000
commitab67260b084615a1451e263c1c05b2f64230c6e1 (patch)
treebce921daf1e129f90eec9e3980cf9d68794ef0dd /lisp/dired-aux.el
parent8a4c10dcc63f575b0a5e20b50757640c0a158ee7 (diff)
downloademacs-ab67260b084615a1451e263c1c05b2f64230c6e1.tar.gz
*** empty log message ***
Diffstat (limited to 'lisp/dired-aux.el')
-rw-r--r--lisp/dired-aux.el42
1 files changed, 5 insertions, 37 deletions
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index e35402b76a7..d81d0641ec4 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -37,8 +37,7 @@
(defun dired-diff (file &optional switches)
"Compare file at point with file FILE using `diff'.
FILE defaults to the file at the mark.
-The prompted-for file is the first file given to `diff'.
-Prefix arg lets you edit the diff switches. See the command `diff'."
+The prompted-for file is the first file given to `diff'."
(interactive
(let ((default (if (mark)
(save-excursion (goto-char (mark))
@@ -60,43 +59,12 @@ Prefix arg lets you edit the diff switches. See the command `diff'."
"Diff this file with its backup file or vice versa.
Uses the latest backup, if there are several numerical backups.
If this file is a backup, diff it with its original.
-The backup file is the first file given to `diff'.
-Prefix arg lets you edit the diff switches. See the command `diff'."
+The backup file is the first file given to `diff'."
(interactive (list (if (fboundp 'diff-read-switches)
(diff-read-switches "Diff with switches: "))))
- (let (bak ori (file (dired-get-filename)))
- (if (backup-file-name-p file)
- (setq bak file
- ori (file-name-sans-versions file))
- (setq bak (or (dired-latest-backup-file file)
- (error "No backup found for %s" file))
- ori file))
- (if switches
- (diff bak ori switches)
- (diff bak ori))))
-
-(defun dired-latest-backup-file (fn) ; actually belongs into files.el
- "Return the latest existing backup of FILE, or nil."
- ;; First try simple backup, then the highest numbered of the
- ;; numbered backups.
- ;; Ignore the value of version-control because we look for existing
- ;; backups, which maybe were made earlier or by another user with
- ;; a different value of version-control.
- (setq fn (expand-file-name fn))
- (or
- (let ((bak (make-backup-file-name fn)))
- (if (file-exists-p bak) bak))
- (let* ((dir (file-name-directory fn))
- (base-versions (concat (file-name-nondirectory fn) ".~"))
- (bv-length (length base-versions)))
- (concat dir
- (car (sort
- (file-name-all-completions base-versions dir)
- ;; bv-length is a fluid var for backup-extract-version:
- (function
- (lambda (fn1 fn2)
- (> (backup-extract-version fn1)
- (backup-extract-version fn2))))))))))
+ (if switches
+ (diff-backup (dired-get-filename) switches)
+ (diff-backup (dired-get-filename))))
(defun dired-do-chxxx (attribute-name program op-symbol arg)
;; Change file attributes (mode, group, owner) of marked files and