branch: elpa/magit
commit 102317db1551709dd12a11faa8b2de0afc31309b
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>

    magit-completing-read: Cosmetics
---
 lisp/magit-base.el | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/lisp/magit-base.el b/lisp/magit-base.el
index d0df3b38a85..b49f2a72677 100644
--- a/lisp/magit-base.el
+++ b/lisp/magit-base.el
@@ -591,12 +591,13 @@ acts similarly to `completing-read', except for the 
following:
   `minibuffer-default-prompt-format' and depending on
   `magit-completing-read-default-prompt-predicate'."
   (setq magit-completing-read--silent-default nil)
-  (if-let ((dwim (and def
-                      (nth 2 (seq-find (pcase-lambda (`(,cmd ,re ,_))
-                                         (and (eq this-command cmd)
-                                              (or (not re)
-                                                  (string-match-p re prompt))))
-                                       magit-dwim-selection)))))
+  (if-let ((def)
+           (dwim (seq-some (pcase-lambda (`(,cmd ,re ,dwim))
+                             (and (eq cmd this-command)
+                                  (or (not re)
+                                      (string-match-p re prompt))
+                                  dwim))
+                           magit-dwim-selection)))
       (if (eq dwim 'ask)
           (if (y-or-n-p (format "%s %s? " prompt def))
               def

Reply via email to