diff options
| author | Thomas Voss <thomas.voss@humanwave.nl> | 2026-03-20 16:38:36 +0100 |
|---|---|---|
| committer | Thomas Voss <thomas.voss@humanwave.nl> | 2026-03-20 16:48:31 +0100 |
| commit | 9049047797a619df4ba5383b73a4cf83988aa30e (patch) | |
| tree | 4a16c3846630f5c21785dd157be7c2973b9a3e36 /.config/emacs/init.el | |
| parent | 2aae06f23408be081a451de38111dd32c1cf07e7 (diff) | |
emacs: Implement ‘mm-camel-to-lisp’
Diffstat (limited to '.config/emacs/init.el')
| -rw-r--r-- | .config/emacs/init.el | 9 |
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) |