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

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

[nongnu] elpa/git-commit a6f9c78374 11/15: Use seq-take and seq-drop ins


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit a6f9c78374 11/15: Use seq-take and seq-drop instead of -split-at
Date: Mon, 31 Jul 2023 10:00:21 -0400 (EDT)

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

    Use seq-take and seq-drop instead of -split-at
---
 lisp/magit-process.el | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/lisp/magit-process.el b/lisp/magit-process.el
index 8295e3b0e9..b766140606 100644
--- a/lisp/magit-process.el
+++ b/lisp/magit-process.el
@@ -674,16 +674,17 @@ Magit status buffer."
 (defun magit-process--format-arguments (program args)
   (cond
    ((and args (equal program (magit-git-executable)))
-    (setq args (-split-at (length magit-git-global-arguments) args))
-    (concat (propertize (file-name-nondirectory program)
-                        'font-lock-face 'magit-section-heading)
-            " "
-            (propertize (magit--ellipsis)
-                        'font-lock-face 'magit-section-heading
-                        'help-echo (mapconcat #'identity (car args) " "))
-            " "
-            (propertize (mapconcat #'shell-quote-argument (cadr args) " ")
-                        'font-lock-face 'magit-section-heading)))
+    (let ((global (length magit-git-global-arguments)))
+      (concat
+       (propertize (file-name-nondirectory program)
+                   'font-lock-face 'magit-section-heading)
+       " "
+       (propertize (magit--ellipsis)
+                   'font-lock-face 'magit-section-heading
+                   'help-echo (mapconcat #'identity (seq-take args global) " 
"))
+       " "
+       (propertize (mapconcat #'shell-quote-argument (seq-drop args global) " 
")
+                   'font-lock-face 'magit-section-heading))))
    ((and args (equal program shell-file-name))
     (propertize (cadr args)
                 'font-lock-face 'magit-section-heading))
@@ -745,10 +746,10 @@ Magit status buffer."
         (--when-let
             (magit-get-section
              `((commit . ,(magit-rev-parse "HEAD"))
-               (,(pcase (car (cadr (-split-at
-                                    (1+ (length magit-git-global-arguments))
-                                    (process-command process))))
-                   ((or "rebase" "am")   'rebase-sequence)
+               (,(pcase (car (seq-drop
+                              (process-command process)
+                              (1+ (length magit-git-global-arguments))))
+                   ((or "rebase" "am") 'rebase-sequence)
                    ((or "cherry-pick" "revert") 'sequence)))
                (status)))
           (goto-char (oref it start))



reply via email to

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