From 4301875e6e41926fe09c34cf18204ee47b37a742 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Mon, 25 Nov 2013 21:04:50 +0200 Subject: [PATCH] * lisp/emacs-lisp/helpers.el (string-join): New function. --- etc/NEWS | 1 + lisp/ChangeLog | 4 +++- lisp/emacs-lisp/helpers.el | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) 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) -- 2.39.2