From 9049047797a619df4ba5383b73a4cf83988aa30e Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Fri, 20 Mar 2026 16:38:36 +0100 Subject: emacs: Implement ‘mm-camel-to-lisp’ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/emacs/init.el | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to '.config/emacs/init.el') 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) -- cgit v1.2.3