aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2006-01-17 01:43:00 +0000
committerJuri Linkov2006-01-17 01:43:00 +0000
commit84bf6ad84efc1975c45540c203480811dcbb7b26 (patch)
tree67dff7cb5dfa4a092a6684d3316ec65122821bf8
parent202e166deac34b7b3c20b26ce0b67a0bdaddb62e (diff)
downloademacs-84bf6ad84efc1975c45540c203480811dcbb7b26.tar.gz
emacs-84bf6ad84efc1975c45540c203480811dcbb7b26.zip
(dired-diff): Use dired-dwim-target-directory
instead of the file at the mark as default if the file at the mark is the same as the file at point or if dired-dwim-target-directory is not the same as the current directory and the mark is not active.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/dired-aux.el12
2 files changed, 14 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 63378f163f6..5c286c57b8f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
12006-01-17 Juri Linkov <juri@jurta.org> 12006-01-17 Juri Linkov <juri@jurta.org>
2 2
3 * dired-aux.el (dired-diff): Use dired-dwim-target-directory
4 instead of the file at the mark as default if the file at the mark
5 is the same as the file at point or if dired-dwim-target-directory
6 is not the same as the current directory and the mark is not active.
7
3 * log-view.el (log-view-minor-wrap): Use the same logic to get 8 * log-view.el (log-view-minor-wrap): Use the same logic to get
4 revisions as `log-view-diff'. 9 revisions as `log-view-diff'.
5 10
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index f946199bbd6..7a34c39bed5 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -53,14 +53,20 @@ FILE defaults to the file at the mark. (That's the mark set by
53\\[set-mark-command], not by Dired's \\[dired-mark] command.) 53\\[set-mark-command], not by Dired's \\[dired-mark] command.)
54The prompted-for file is the first file given to `diff'. 54The prompted-for file is the first file given to `diff'.
55With prefix arg, prompt for second argument SWITCHES, 55With prefix arg, prompt for second argument SWITCHES,
56 which is options for `diff'." 56which is options for `diff'."
57 (interactive 57 (interactive
58 (let ((default (if (mark t) 58 (let ((current (dired-get-filename t))
59 (default (if (mark t)
59 (save-excursion (goto-char (mark t)) 60 (save-excursion (goto-char (mark t))
60 (dired-get-filename t t))))) 61 (dired-get-filename t t)))))
62 (if (or (equal default current)
63 (and (not (equal (dired-dwim-target-directory)
64 (dired-current-directory)))
65 (not mark-active)))
66 (setq default nil))
61 (require 'diff) 67 (require 'diff)
62 (list (read-file-name (format "Diff %s with%s: " 68 (list (read-file-name (format "Diff %s with%s: "
63 (dired-get-filename t) 69 current
64 (if default 70 (if default
65 (concat " (default " default ")") 71 (concat " (default " default ")")
66 "")) 72 ""))