emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/git-commit 4efdc7066f 3/6: magit-process-yes-or-no-prompt:


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit 4efdc7066f 3/6: magit-process-yes-or-no-prompt: Cosmetics
Date: Sat, 22 Jul 2023 22:01:16 -0400 (EDT)

branch: elpa/git-commit
commit 4efdc7066f3d6ecde2c1f93e09823112c878e29f
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    magit-process-yes-or-no-prompt: Cosmetics
    
    A bit of duplication seems preferable to the deep nesting we had
    before.
---
 lisp/magit-process.el | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/lisp/magit-process.el b/lisp/magit-process.el
index 278fb85509..64295e3bd8 100644
--- a/lisp/magit-process.el
+++ b/lisp/magit-process.el
@@ -802,17 +802,14 @@ Magit status buffer."
 (defun magit-process-yes-or-no-prompt (process string)
   "Forward Yes-or-No prompts to the user."
   (when-let ((beg (string-match magit-process-yes-or-no-prompt-regexp string)))
-    (let ((max-mini-window-height 30))
-      (process-send-string
-       process
-       (downcase
-        (concat
-         (match-string
-          (if (save-match-data
-                (magit-process-kill-on-abort process
-                  (yes-or-no-p (substring string 0 beg)))) 1 2)
-          string)
-         "\n"))))))
+    (process-send-string
+     process
+     (if (save-match-data
+           (let ((max-mini-window-height 30))
+             (magit-process-kill-on-abort process
+               (yes-or-no-p (substring string 0 beg)))))
+         (concat (downcase (match-string 1 string)) "\n")
+       (concat (downcase (match-string 2 string)) "\n")))))
 
 (defun magit-process-password-auth-source (key)
   "Use `auth-source-search' to get a password.



reply via email to

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