Skip to content

Commit

Permalink
Fix mapconcat
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Nov 26, 2023
1 parent d46d0d2 commit 75fec95
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ic.el
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

;;; Code:

(require 'cl-lib)
(require 'pp)

(require 'ppp)
Expand Down Expand Up @@ -119,12 +120,15 @@ Arguments FNC and ARGS are for function `advice-add'."
Arguments FUNC and SEQ are for function `mapconcat'."
(let ((result "")
(next-sep)
(next-str))
(next-str)
(count 0)
(len (1- (length seq))))
(dolist (elm seq)
(setq next-str (funcall func elm)
next-sep (if (string-suffix-p "\n" next-str) "" " ")
result (concat result next-str next-sep)))
(string-trim result)))
result (concat result next-str (if (= count len) "" next-sep)))
(cl-incf count))
result))

;;;###autoload
(defun ic-message (&rest args)
Expand Down

0 comments on commit 75fec95

Please sign in to comment.