emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Mark in dired-diff


From: Juri Linkov
Subject: Mark in dired-diff
Date: Fri, 02 Dec 2005 03:34:22 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

When dired-dwim-target is t (which uses the name of a dired buffer
displayed in the next window in the prompt), the mark in the current
dired buffer makes it impossible for dired-diff to insert the directory
name from the next window as the default value in the minibuffer.
That's because the mark in the current buffer takes precedence over
the value of dired-dwim-target.  The mark indicates the target file
in the current dired buffer, but often it is just a leftover from the
previous operation.

What is a good way to resolve this conflict?  I think a good heuristics
would be to check if the mark is active in transient-mark-mode
if there exists a dwim target directory which is not the same as the
current dired directory.

Index: lisp/dired-aux.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/dired-aux.el,v
retrieving revision 1.141
diff -c -r1.141 dired-aux.el
*** lisp/dired-aux.el   24 Sep 2005 23:26:28 -0000      1.141
--- lisp/dired-aux.el   2 Dec 2005 01:33:23 -0000
***************
*** 55,61 ****
  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))
                                      (dired-get-filename t t)))))
       (require 'diff)
--- 55,64 ----
  With prefix arg, prompt for second argument SWITCHES,
   which is options for `diff'."
    (interactive
!    (let ((default (if (if (equal (dired-dwim-target-directory)
!                                (dired-current-directory))
!                         (mark t)
!                       mark-active)
                      (save-excursion (goto-char (mark t))
                                      (dired-get-filename t t)))))
       (require 'diff)

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]