diff options
author | Tianxiang Xiong <tianxiang.xiong@gmail.com> | 2016-10-19 18:51:14 -0700 |
---|---|---|
committer | Tianxiang Xiong <tianxiang.xiong@gmail.com> | 2016-10-19 18:51:14 -0700 |
commit | 1266c13d4c8b7caf5c9146d717856da47f417c9f (patch) | |
tree | 9add90dc4168736ceb0519454e3c734783007471 /s.el | |
parent | fc395c8d5e6c14d5e0920ab80d4d5df007eed14a (diff) |
Alias all functions ending in `?`
Diffstat (limited to 's.el')
-rw-r--r-- | s.el | 40 |
1 files changed, 23 insertions, 17 deletions
@@ -235,8 +235,6 @@ Alias: `s-suffix?'" (eq t (compare-strings suffix nil nil s start-pos nil ignore-case))))) -(defalias 's-ends-with-p 's-ends-with?) - (defun s-starts-with? (prefix s &optional ignore-case) "Does S start with PREFIX? @@ -247,13 +245,6 @@ Alias: `s-prefix?'. This is a simple wrapper around the built-in `string-prefix-p'." (string-prefix-p prefix s ignore-case)) -(defalias 's-starts-with-p 's-starts-with?) - -(defalias 's-suffix? 's-ends-with?) -(defalias 's-prefix? 's-starts-with?) -(defalias 's-suffix-p 's-ends-with?) -(defalias 's-prefix-p 's-starts-with?) - (defun s--truthy? (val) (not (null val))) @@ -265,24 +256,18 @@ attention to case differences." (let ((case-fold-search ignore-case)) (s--truthy? (string-match-p (regexp-quote needle) s)))) -(defalias 's-contains-p 's-contains?) - (defun s-equals? (s1 s2) "Is S1 equal to S2? This is a simple wrapper around the built-in `string-equal'." (string-equal s1 s2)) -(defalias 's-equals-p 's-equals?) - (defun s-less? (s1 s2) "Is S1 less than S2? This is a simple wrapper around the built-in `string-lessp'." (string-lessp s1 s2)) -(defalias 's-less-p 's-less?) - (defun s-matches? (regexp s &optional start) "Does REGEXP match S? If START is non-nil the search starts at that index. @@ -290,8 +275,6 @@ If START is non-nil the search starts at that index. This is a simple wrapper around the built-in `string-match-p'." (s--truthy? (string-match-p regexp s start))) -(defalias 's-matches-p 's-matches?) - (defun s-blank? (s) "Is S nil or the empty string?" (or (null s) (string= "" s))) @@ -627,5 +610,28 @@ is appended, otherwise PREFIX is used as both prefix and suffix." (concat prefix s (or suffix prefix))) + +;;; Aliases + +(defalias 's-blank-p 's-blank?) +(defalias 's-blank-str-p 's-blank-str?) +(defalias 's-capitalized-p 's-capitalized?) +(defalias 's-contains-p 's-contains?) +(defalias 's-ends-with-p 's-ends-with?) +(defalias 's-equals-p 's-equals?) +(defalias 's-less-p 's-less?) +(defalias 's-lowercase-p 's-lowercase?) +(defalias 's-matches-p 's-matches?) +(defalias 's-mixedcase-p 's-mixedcase?) +(defalias 's-numeric-p 's-numeric?) +(defalias 's-prefix-p 's-starts-with?) +(defalias 's-prefix? 's-starts-with?) +(defalias 's-present-p 's-present?) +(defalias 's-starts-with-p 's-starts-with?) +(defalias 's-suffix-p 's-ends-with?) +(defalias 's-suffix? 's-ends-with?) +(defalias 's-uppercase-p 's-uppercase?) + + (provide 's) ;;; s.el ends here |