mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-26 07:33:47 +00:00
* lisp/emacs-lisp/helpers.el (string-empty-p): New function.
(string-blank-p): New function
This commit is contained in:
parent
7efb806d46
commit
015b3b3e8e
2
etc/NEWS
2
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'
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user