From: Bozhidar Batsov Date: Mon, 25 Nov 2013 19:04:50 +0000 (+0200) Subject: * lisp/emacs-lisp/helpers.el (string-join): New function. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~696 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4301875e6e41926fe09c34cf18204ee47b37a742;p=emacs.git * lisp/emacs-lisp/helpers.el (string-join): New function. --- diff --git a/etc/NEWS b/etc/NEWS index e46d0fdc61a..9b0d2eb14c6 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -775,6 +775,7 @@ frame. ** New library helpers.el for misc helper functions *** `hash-table-keys' *** `hash-table-values' +*** `string-join` *** `string-trim-left' *** `string-trim-right' *** `string-trim' diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 06b614ea2fa..6f5519e8803 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,9 @@ -2013-11-25 Bozhidar Batsov +2013-11-25 Bozhidar Batsov * emacs-lisp/bytecomp.el (byte-compile-form): Fix a typo. + * emacs-lisp/helpers.el (string-join): New function. + 2013-11-25 Sebastian Wiesner * emacs-lisp/bytecomp.el (byte-compile-interactive-only-functions): diff --git a/lisp/emacs-lisp/helpers.el b/lisp/emacs-lisp/helpers.el index fd5985467b5..a8e6c494c4d 100644 --- a/lisp/emacs-lisp/helpers.el +++ b/lisp/emacs-lisp/helpers.el @@ -37,6 +37,10 @@ (maphash (lambda (_k v) (push v values)) hash-table) values)) +(defsubst string-join (strings &optional separator) + "Join all STRINGS using SEPARATOR." + (mapconcat 'identity strings separator)) + (defsubst string-trim-left (string) "Remove leading whitespace from STRING." (if (string-match "\\`[ \t\n\r]+" string)