summaryrefslogtreecommitdiff
path: root/.config/emacs/init.el
diff options
context:
space:
mode:
Diffstat (limited to '.config/emacs/init.el')
-rw-r--r--.config/emacs/init.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/.config/emacs/init.el b/.config/emacs/init.el
index eb0f23e..0f917c7 100644
--- a/.config/emacs/init.el
+++ b/.config/emacs/init.el
@@ -73,6 +73,15 @@ This function is meant to be used in conjuction with `read-string' and
(string-to-number string-or-number)
string-or-number))
+(defun mm-camel-to-lisp (string)
+ "Convert STRING from camelCase to lisp-case."
+ (declare (ftype (function (string) string))
+ (pure t) (side-effect-free t))
+ (let ((case-fold-search nil))
+ (downcase
+ (replace-regexp-in-string
+ (rx (group (or lower digit)) (group upper)) "\\1-\\2" string))))
+
(defun mm-do-and-center (function &rest arguments)
"Call FUNCTION with ARGUMENTS and then center the screen."
(apply function arguments)