about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2018-05-29T20·24-0400
committerWilliam Carroll <wpcarro@gmail.com>2018-07-19T16·00-0400
commite2891432e28faff7a0ed9835ccfe202728b7df83 (patch)
treecf9c2e6a3628ba77ddfd13c60bdb334ed4a66d01
parent32ac66d50b62e77a81866520a40195e3d15b90f2 (diff)
Support additional casing xformations
More Elisp functions for transforming text casing!
-rw-r--r--emacs.d/wpc/casing.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/emacs.d/wpc/casing.el b/emacs.d/wpc/casing.el
index 0592d9dddb08..598833a9f6c5 100644
--- a/emacs.d/wpc/casing.el
+++ b/emacs.d/wpc/casing.el
@@ -25,6 +25,16 @@
        s-upcase
        (s-replace "-" "_")))
 
+(defun lower->caps (x)
+  "Change the casing of X from lowercase to CAPS_CASE."
+  (->> x
+       s-upcase
+       (s-replace " " "_")))
+
+(defun lower->kebab (x)
+  "Change the casing of X from lowercase to kebab-case"
+  (s-replace " " "-" x))
+
 ;;; Tests:
 
 (ert-deftest caps->kebab-test ()