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

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

[elpa] externals/detached e0da0bcefb 2/4: Replace use of mapconcat with


From: ELPA Syncer
Subject: [elpa] externals/detached e0da0bcefb 2/4: Replace use of mapconcat with string-join
Date: Thu, 1 Sep 2022 14:57:40 -0400 (EDT)

branch: externals/detached
commit e0da0bcefbb2ee06e318f956da56ae44ca97c9db
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>

    Replace use of mapconcat with string-join
---
 detached-eshell.el |  5 +----
 detached.el        | 44 +++++++++++++++++++++-----------------------
 2 files changed, 22 insertions(+), 27 deletions(-)

diff --git a/detached-eshell.el b/detached-eshell.el
index 68b88aaf89..32aba9ed52 100644
--- a/detached-eshell.el
+++ b/detached-eshell.el
@@ -47,10 +47,7 @@
 (defun detached-eshell-external-command (orig-fun &rest args)
   "Advice `eshell-external-command' to optionally use `detached'."
   (let* ((detached-session-action detached-eshell-session-action)
-         (command (string-trim-right
-                   (mapconcat #'identity
-                              (flatten-list args)
-                              " ")))
+         (command (string-trim-right (string-join (flatten-list args) " ")))
          (session (detached-create-session command))
          (command (detached--shell-command session)))
     (advice-remove #'eshell-external-command 
#'detached-eshell-external-command)
diff --git a/detached.el b/detached.el
index 5f36badfc2..ec901cf371 100644
--- a/detached.el
+++ b/detached.el
@@ -49,6 +49,7 @@
 (require 'notifications)
 (require 'filenotify)
 (require 'simple)
+(require 'subr-x)
 (require 'tramp)
 
 (declare-function detached-eshell--get-dtach-process "detached-eshell")
@@ -643,8 +644,7 @@ Optionally SUPPRESS-OUTPUT."
 (defun detached-session-annotation (item)
   "Associate ITEM to a session and return ts annotation."
   (let ((session (cdr (assoc item detached--session-candidates))))
-    (mapconcat
-     #'identity
+    (string-join
      (cl-loop for annotation in detached-annotation-format
               collect (let ((str (funcall (plist-get annotation :function) 
session))
                             (width (alist-get (plist-get annotation :function) 
detached--annotation-widths)))
@@ -654,8 +654,7 @@ Optionally SUPPRESS-OUTPUT."
                             (propertize str 'face (plist-get annotation :face))
                             width
                             0 ?\s)
-                           (make-string (plist-get annotation :padding) ?\s)
-                           ))))
+                           (make-string (plist-get annotation :padding) 
?\s)))))
      "")))
 
 ;;;###autoload
@@ -832,11 +831,11 @@ Optionally CONCAT the command return command into a 
string."
                   (detached--current-session session))
               (detached-start-session (detached--session-command session))
               (if concat
-                  (mapconcat #'identity tail-command " ")
+                  (string-join tail-command " ")
                 tail-command)))
            ((eq 'attach detached-session-mode)
             (if concat
-                (mapconcat #'identity tail-command " ")
+                (string-join tail-command " ")
               tail-command))))))
 
 (cl-defgeneric detached--dtach-command (entity &optional concat)
@@ -859,27 +858,27 @@ Optionally CONCAT the command return command into a 
string."
      (setq detached--buffer-session session)
      (if (eq detached-session-mode 'attach)
          (if concat
-             (mapconcat #'identity
-                        `(,(when detached-show-session-context
-                             (format  "%s --lines=%s %s;" 
detached-tail-program detached-session-context-lines log))
-                          ,detached-dtach-program
-                          ,dtach-arg
-                          ,socket
-                          "-r none")
-                        " ")
+             (string-join
+              `(,(when detached-show-session-context
+                   (format  "%s --lines=%s %s;" detached-tail-program 
detached-session-context-lines log))
+                ,detached-dtach-program
+                ,dtach-arg
+                ,socket
+                "-r none")
+              " ")
            (append
             (when detached-show-session-context
               `(,detached-tail-program ,(format "--lines=%s" 
detached-session-context-lines)
                                        ,(concat log ";")))
             `(,detached-dtach-program ,dtach-arg ,socket "-r" "none")))
        (if concat
-           (mapconcat #'identity
-                      `(,detached-dtach-program
-                        ,dtach-arg
-                        ,socket "-z"
-                        ,detached-shell-program "-c"
-                        ,(shell-quote-argument (detached--detached-command 
session)))
-                      " ")
+           (string-join
+            `(,detached-dtach-program
+              ,dtach-arg
+              ,socket "-z"
+              ,detached-shell-program "-c"
+              ,(shell-quote-argument (detached--detached-command session)))
+            " ")
          `(,detached-dtach-program
            ,dtach-arg ,socket "-z"
            ,detached-shell-program "-c"
@@ -971,8 +970,7 @@ Optionally CONCAT the command return command into a string."
 
 (defun detached--session-header (session)
   "Return header for SESSION."
-  (mapconcat
-   #'identity
+  (string-join
    `(,(format "Command: %s" (detached--session-command session))
      ,(format "Working directory: %s" (detached--working-dir-str session))
      ,(format "Host: %s" (car (detached--session-host session)))



reply via email to

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