diff options
| author | Bozhidar Batsov | 2013-11-29 18:51:44 +0200 |
|---|---|---|
| committer | Bozhidar Batsov | 2013-11-29 18:51:44 +0200 |
| commit | 015b3b3e8ec1330a0bbe3981e7070df8e17c9399 (patch) | |
| tree | 75f8ac5c9893b39cb2016c9acc5eebb169f78202 /lisp | |
| parent | 7efb806d46b13b5efbfe04f94000535949ca8dff (diff) | |
| download | emacs-015b3b3e8ec1330a0bbe3981e7070df8e17c9399.tar.gz emacs-015b3b3e8ec1330a0bbe3981e7070df8e17c9399.zip | |
* lisp/emacs-lisp/helpers.el (string-empty-p): New function.
(string-blank-p): New function
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/emacs-lisp/helpers.el | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ac425d76154..4e838dd4181 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-11-29 Bozhidar Batsov <bozhidar@batsov.com> | ||
| 2 | |||
| 3 | * emacs-lisp/helpers.el (string-empty-p): New function. | ||
| 4 | (string-blank-p): New function. | ||
| 5 | |||
| 1 | 2013-11-29 Andreas Politz <politza@hochschule-trier.de> | 6 | 2013-11-29 Andreas Politz <politza@hochschule-trier.de> |
| 2 | 7 | ||
| 3 | * imenu.el (imenu--index-alist): Add missing dot to the docstring | 8 | * imenu.el (imenu--index-alist): Add missing dot to the docstring |
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 @@ | |||
| 37 | (maphash (lambda (_k v) (push v values)) hash-table) | 37 | (maphash (lambda (_k v) (push v values)) hash-table) |
| 38 | values)) | 38 | values)) |
| 39 | 39 | ||
| 40 | (defsubst string-empty-p (string) | ||
| 41 | "Check whether STRING is empty." | ||
| 42 | (string= string "")) | ||
| 43 | |||
| 40 | (defsubst string-join (strings &optional separator) | 44 | (defsubst string-join (strings &optional separator) |
| 41 | "Join all STRINGS using SEPARATOR." | 45 | "Join all STRINGS using SEPARATOR." |
| 42 | (mapconcat 'identity strings separator)) | 46 | (mapconcat 'identity strings separator)) |
| @@ -61,6 +65,10 @@ | |||
| 61 | "Remove leading and trailing whitespace from STRING." | 65 | "Remove leading and trailing whitespace from STRING." |
| 62 | (string-trim-left (string-trim-right string))) | 66 | (string-trim-left (string-trim-right string))) |
| 63 | 67 | ||
| 68 | (defsubst string-blank-p (string) | ||
| 69 | "Check whether STRING is either empty or only whitespace." | ||
| 70 | (string-empty-p (string-trim string))) | ||
| 71 | |||
| 64 | (provide 'helpers) | 72 | (provide 'helpers) |
| 65 | 73 | ||
| 66 | ;;; helpers.el ends here | 74 | ;;; helpers.el ends here |