summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/helpers.el
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@batsov.com>2013-11-29 18:51:44 +0200
committerBozhidar Batsov <bozhidar@batsov.com>2013-11-29 18:51:44 +0200
commit015b3b3e8ec1330a0bbe3981e7070df8e17c9399 (patch)
tree75f8ac5c9893b39cb2016c9acc5eebb169f78202 /lisp/emacs-lisp/helpers.el
parent7efb806d46b13b5efbfe04f94000535949ca8dff (diff)
downloademacs-015b3b3e8ec1330a0bbe3981e7070df8e17c9399.tar.gz
emacs-015b3b3e8ec1330a0bbe3981e7070df8e17c9399.tar.bz2
emacs-015b3b3e8ec1330a0bbe3981e7070df8e17c9399.zip
* lisp/emacs-lisp/helpers.el (string-empty-p): New function.
(string-blank-p): New function
Diffstat (limited to 'lisp/emacs-lisp/helpers.el')
-rw-r--r--lisp/emacs-lisp/helpers.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/helpers.el b/lisp/emacs-lisp/helpers.el
index 8be0c628486..8049f4e1d1d 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-empty-p (string)
+ "Check whether STRING is empty."
+ (string= string ""))
+
(defsubst string-join (strings &optional separator)
"Join all STRINGS using SEPARATOR."
(mapconcat 'identity strings separator))
@@ -61,6 +65,10 @@
"Remove leading and trailing whitespace from STRING."
(string-trim-left (string-trim-right string)))
+(defsubst string-blank-p (string)
+ "Check whether STRING is either empty or only whitespace."
+ (string-empty-p (string-trim string)))
+
(provide 'helpers)
;;; helpers.el ends here