diff options
author | William Carroll <wpcarro@gmail.com> | 2018-05-29T20·24-0400 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2018-07-19T16·00-0400 |
commit | e2891432e28faff7a0ed9835ccfe202728b7df83 (patch) | |
tree | cf9c2e6a3628ba77ddfd13c60bdb334ed4a66d01 /emacs.d | |
parent | 32ac66d50b62e77a81866520a40195e3d15b90f2 (diff) |
Support additional casing xformations
More Elisp functions for transforming text casing!
Diffstat (limited to 'emacs.d')
-rw-r--r-- | emacs.d/wpc/casing.el | 10 |
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 () |