summaryrefslogtreecommitdiff
path: root/s.el
diff options
context:
space:
mode:
authorJohan Andersson <johan.rejeep@gmail.com>2013-09-04 20:01:54 +0200
committerJohan Andersson <johan.rejeep@gmail.com>2013-09-04 20:01:54 +0200
commitaac4a2faff9fb5f61983aaf95f6c2a5f7b354d9f (patch)
tree5d0a6c501c465bda381301a8aa2d47455a350591 /s.el
parent7db17c807492aa74390f115aaeb6ac22deda9bda (diff)
Add s-present?
Diffstat (limited to 's.el')
-rw-r--r--s.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/s.el b/s.el
index d9d2fed..bcf472b 100644
--- a/s.el
+++ b/s.el
@@ -264,6 +264,10 @@ This is a simple wrapper around the built-in `string-match-p'."
"Is S nil or the empty string?"
(or (null s) (string= "" s)))
+(defun s-present? (s)
+ "Is S anything but nil or the empty string?"
+ (not (s-blank? s)))
+
(defun s-presence (s)
"Return S if it's not `s-blank?', otherwise return nil."
(unless (s-blank? s) s))