diff options
| author | Juri Linkov | 2009-12-16 09:52:42 +0000 |
|---|---|---|
| committer | Juri Linkov | 2009-12-16 09:52:42 +0000 |
| commit | 72b57560300f433795ef02115b7085e5699cea03 (patch) | |
| tree | f4d88c9632d65d9c69d06cf011e58f2a79069c55 | |
| parent | 7eeb56addbec7cd5dd9226b5a7f4710f7e8c39b1 (diff) | |
| download | emacs-72b57560300f433795ef02115b7085e5699cea03.tar.gz emacs-72b57560300f433795ef02115b7085e5699cea03.zip | |
Revert to old 23.1 logic of using the file at the mark as default.
* dired-aux.el (dired-diff): Use the file at the mark as default
if it's not the same as the current file, and the target dir is
the current dir or the mark is active. Add the current file
as the arg of `dired-dwim-target-defaults'. Use the default file
in the prompt. (Bug#5225)
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/dired-aux.el | 28 |
2 files changed, 28 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 26ff5d4c7ce..cd139b72456 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2009-12-16 Juri Linkov <juri@jurta.org> | ||
| 2 | |||
| 3 | Revert to old 23.1 logic of using the file at the mark as default. | ||
| 4 | * dired-aux.el (dired-diff): Use the file at the mark as default | ||
| 5 | if it's not the same as the current file, and the target dir is | ||
| 6 | the current dir or the mark is active. Add the current file | ||
| 7 | as the arg of `dired-dwim-target-defaults'. Use the default file | ||
| 8 | in the prompt. (Bug#5225) | ||
| 9 | |||
| 1 | 2009-12-15 Michael Albinus <michael.albinus@gmx.de> | 10 | 2009-12-15 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 11 | ||
| 3 | * net/tramp.el (tramp-echo-mark-marker-length): New defconst. | 12 | * net/tramp.el (tramp-echo-mark-marker-length): New defconst. |
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 4976d2cd683..d3f5de72c7f 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el | |||
| @@ -60,21 +60,31 @@ With prefix arg, prompt for second argument SWITCHES, | |||
| 60 | which is options for `diff'." | 60 | which is options for `diff'." |
| 61 | (interactive | 61 | (interactive |
| 62 | (let* ((current (dired-get-filename t)) | 62 | (let* ((current (dired-get-filename t)) |
| 63 | (target-dir (dired-dwim-target-directory)) | 63 | ;; Get the file at the mark. |
| 64 | (marked (and (mark t) (save-excursion | 64 | (file-at-mark (if (mark t) |
| 65 | (goto-char (mark t)) | 65 | (save-excursion (goto-char (mark t)) |
| 66 | (dired-get-filename nil t)))) | 66 | (dired-get-filename t t)))) |
| 67 | (defaults | 67 | ;; Use it as default if it's not the same as the current file, |
| 68 | (append (dired-dwim-target-defaults nil target-dir) | 68 | ;; and the target dir is the current dir or the mark is active. |
| 69 | ;; Additional file with the mark. | 69 | (default (if (and (not (equal file-at-mark current)) |
| 70 | (and marked (list marked))))) | 70 | (or (equal (dired-dwim-target-directory) |
| 71 | (dired-current-directory)) | ||
| 72 | mark-active)) | ||
| 73 | file-at-mark)) | ||
| 74 | (target-dir (if default | ||
| 75 | (dired-current-directory) | ||
| 76 | (dired-dwim-target-directory))) | ||
| 77 | (defaults (dired-dwim-target-defaults (list current) target-dir))) | ||
| 71 | (require 'diff) | 78 | (require 'diff) |
| 72 | (list | 79 | (list |
| 73 | (minibuffer-with-setup-hook | 80 | (minibuffer-with-setup-hook |
| 74 | (lambda () | 81 | (lambda () |
| 75 | (set (make-local-variable 'minibuffer-default-add-function) nil) | 82 | (set (make-local-variable 'minibuffer-default-add-function) nil) |
| 76 | (setq minibuffer-default defaults)) | 83 | (setq minibuffer-default defaults)) |
| 77 | (read-file-name (format "Diff %s with: " current) target-dir nil t)) | 84 | (read-file-name |
| 85 | (format "Diff %s with%s: " current | ||
| 86 | (if default (format " (default %s)" default) "")) | ||
| 87 | target-dir default t)) | ||
| 78 | (if current-prefix-arg | 88 | (if current-prefix-arg |
| 79 | (read-string "Options for diff: " | 89 | (read-string "Options for diff: " |
| 80 | (if (stringp diff-switches) | 90 | (if (stringp diff-switches) |