Subject: bug#41261: 27.0.90; Dired default file operation target no longer guessed

From: Leo Vivier <[email-masked]>
Date: Fri, 15 May 2020 00:09:18 +0200

Hi there,

I went ahead and wrote the patch.

HTH,

-- 
Leo Vivier

>From 8169360984fea404d3cacc4e17124c27c0a18a79 Mon Sep 17 00:00:00 2001
From: Leo Vivier <[email-masked]>
Date: Fri, 15 May 2020 00:03:18 +0200
Subject: [PATCH] Fix dired default file operation (bug#41261)

---
 lisp/dired-aux.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 0069c1744d..7f988540c2 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -2002,10 +2002,9 @@ dired-mark-read-file-name
    (format prompt (dired-mark-prompt arg files)) dir default))
 
 (defun dired-dwim-target-directories ()
-  (cond ((functionp dired-dwim-target)
-         (funcall dired-dwim-target))
-        (dired-dwim-target
-         (dired-dwim-target-next))))
+  (if (functionp dired-dwim-target)
+      (funcall dired-dwim-target)
+    (dired-dwim-target-next)))
 
 (defun dired-dwim-target-next (&optional all-frames)
   ;; Return directories from all next windows with dired-mode buffers.
-- 
2.26.2