summaryrefslogtreecommitdiff
path: root/lisp/dired-aux.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-08-07 19:25:43 +0000
committerRichard M. Stallman <rms@gnu.org>1993-08-07 19:25:43 +0000
commite698179f7cca2bcc609c1072d4006ef12a740e54 (patch)
tree3384aeb2ca2c19d5877bad471e76c32bdb0ae3df /lisp/dired-aux.el
parentfd39c7c02e2dfe3c1b465229fa4b822a1d5e839d (diff)
downloademacs-e698179f7cca2bcc609c1072d4006ef12a740e54.tar.gz
(dired-diff): Read options right here;
don't try to use diff-read-switches. Always call diff with 3 args. (dired-backup-diff): Likewise.
Diffstat (limited to 'lisp/dired-aux.el')
-rw-r--r--lisp/dired-aux.el31
1 files changed, 19 insertions, 12 deletions
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index e83bb0fd5e6..6af1984dc2f 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -43,7 +43,9 @@
(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'."
+The prompted-for file is the first file given to `diff'.
+With prefix arg, prompt for second argument SWITCHES,
+ which is options for `diff'."
(interactive
(let ((default (if (mark t)
(save-excursion (goto-char (mark t))
@@ -54,23 +56,28 @@ The prompted-for file is the first file given to `diff'."
(concat "(default " default ") ")
""))
(dired-current-directory) default t)
- (if (fboundp 'diff-read-switches)
- (diff-read-switches "Options for diff: ")))))
- (if switches ; Emacs 19's diff has but two
- (diff file (dired-get-filename t) switches) ; args (yet ;-)
- (diff file (dired-get-filename t))))
+ (if current-prefix-arg
+ (read-string "Options for diff: "
+ (if (stringp diff-switches)
+ diff-switches
+ (mapconcat 'identity diff-switches " ")))))))
+ (diff file (dired-get-filename t) switches))
;;;###autoload
(defun dired-backup-diff (&optional switches)
"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'."
- (interactive (list (if (fboundp 'diff-read-switches)
- (diff-read-switches "Diff with switches: "))))
- (if switches
- (diff-backup (dired-get-filename) switches)
- (diff-backup (dired-get-filename))))
+The backup file is the first file given to `diff'.
+With prefix arg, prompt for argument SWITCHES which is options for `diff'."
+ (interactive
+ (if current-prefix-arg
+ (list (read-string "Options for diff: "
+ (if (stringp diff-switches)
+ diff-switches
+ (mapconcat 'identity diff-switches " "))))
+ nil))
+ (diff-backup (dired-get-filename) switches))
(defun dired-do-chxxx (attribute-name program op-symbol arg)
;; Change file attributes (mode, group, owner) of marked files and