aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1993-08-07 19:25:43 +0000
committerRichard M. Stallman1993-08-07 19:25:43 +0000
commitfe5e3a2acacde810697abb499f27537beae9b3f1 (patch)
treeaecc7dbaddf7b6fb544c859ad1abbab0d219aed3
parent34b45e324e4ba164d28bfedea9400c4ed11e673e (diff)
downloademacs-fe5e3a2acacde810697abb499f27537beae9b3f1.tar.gz
emacs-fe5e3a2acacde810697abb499f27537beae9b3f1.zip
(dired-diff): Read options right here;
don't try to use diff-read-switches. Always call diff with 3 args. (dired-backup-diff): Likewise.
-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 @@
43(defun dired-diff (file &optional switches) 43(defun dired-diff (file &optional switches)
44 "Compare file at point with file FILE using `diff'. 44 "Compare file at point with file FILE using `diff'.
45FILE defaults to the file at the mark. 45FILE defaults to the file at the mark.
46The prompted-for file is the first file given to `diff'." 46The prompted-for file is the first file given to `diff'.
47With prefix arg, prompt for second argument SWITCHES,
48 which is options for `diff'."
47 (interactive 49 (interactive
48 (let ((default (if (mark t) 50 (let ((default (if (mark t)
49 (save-excursion (goto-char (mark t)) 51 (save-excursion (goto-char (mark t))
@@ -54,23 +56,28 @@ The prompted-for file is the first file given to `diff'."
54 (concat "(default " default ") ") 56 (concat "(default " default ") ")
55 "")) 57 ""))
56 (dired-current-directory) default t) 58 (dired-current-directory) default t)
57 (if (fboundp 'diff-read-switches) 59 (if current-prefix-arg
58 (diff-read-switches "Options for diff: "))))) 60 (read-string "Options for diff: "
59 (if switches ; Emacs 19's diff has but two 61 (if (stringp diff-switches)
60 (diff file (dired-get-filename t) switches) ; args (yet ;-) 62 diff-switches
61 (diff file (dired-get-filename t)))) 63 (mapconcat 'identity diff-switches " ")))))))
64 (diff file (dired-get-filename t) switches))
62 65
63;;;###autoload 66;;;###autoload
64(defun dired-backup-diff (&optional switches) 67(defun dired-backup-diff (&optional switches)
65 "Diff this file with its backup file or vice versa. 68 "Diff this file with its backup file or vice versa.
66Uses the latest backup, if there are several numerical backups. 69Uses the latest backup, if there are several numerical backups.
67If this file is a backup, diff it with its original. 70If this file is a backup, diff it with its original.
68The backup file is the first file given to `diff'." 71The backup file is the first file given to `diff'.
69 (interactive (list (if (fboundp 'diff-read-switches) 72With prefix arg, prompt for argument SWITCHES which is options for `diff'."
70 (diff-read-switches "Diff with switches: ")))) 73 (interactive
71 (if switches 74 (if current-prefix-arg
72 (diff-backup (dired-get-filename) switches) 75 (list (read-string "Options for diff: "
73 (diff-backup (dired-get-filename)))) 76 (if (stringp diff-switches)
77 diff-switches
78 (mapconcat 'identity diff-switches " "))))
79 nil))
80 (diff-backup (dired-get-filename) switches))
74 81
75(defun dired-do-chxxx (attribute-name program op-symbol arg) 82(defun dired-do-chxxx (attribute-name program op-symbol arg)
76 ;; Change file attributes (mode, group, owner) of marked files and 83 ;; Change file attributes (mode, group, owner) of marked files and