* lisp/emacs-lisp/helpers.el (string-empty-p): New function.
authorBozhidar Batsov <bozhidar@batsov.com>
Fri, 29 Nov 2013 16:51:44 +0000 (18:51 +0200)
committerBozhidar Batsov <bozhidar@batsov.com>
Fri, 29 Nov 2013 16:51:44 +0000 (18:51 +0200)
(string-blank-p): New function

etc/NEWS
lisp/ChangeLog
lisp/emacs-lisp/helpers.el

index 6b0d184..2f9f84d 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -787,6 +787,8 @@ frame.
 ** New library helpers.el for misc helper functions
 *** `hash-table-keys'
 *** `hash-table-values'
+*** `string-blank-p`
+*** `string-empty-p`
 *** `string-join`
 *** `string-reverse`
 *** `string-trim-left'
index ac425d7..4e838dd 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-29  Bozhidar Batsov  <bozhidar@batsov.com>
+
+       * emacs-lisp/helpers.el (string-empty-p): New function.
+       (string-blank-p): New function.
+
 2013-11-29  Andreas Politz  <politza@hochschule-trier.de>
 
        * imenu.el (imenu--index-alist): Add missing dot to the docstring
index 8be0c62..8049f4e 100644 (file)
     (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))
   "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