From f2d971cfe55cbfbeb1b67e43f11eb52c85e40db4 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Mon, 9 Sep 2024 22:37:03 +0200 Subject: emacs: Add x-string-split --- .config/emacs/init.el | 6 ++++++ 1 file changed, 6 insertions(+) (limited to '.config') diff --git a/.config/emacs/init.el b/.config/emacs/init.el index a29893f..420c8d8 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -66,6 +66,12 @@ BODY directly after ‘(interactive)’." (string-remove-suffix "-mode" (symbol-name mode)) "-ts-mode"))) +(defun x-string-split (separators string) + "Wrapper around ‘string-split' that puts SEPARATORS first. This makes +it convenient to use in ‘thread-last’." + (declare (pure t) (side-effect-free t)) + (string-split string separators)) + (defun x-do-and-center (function &rest arguments) "Call FUNCTION with ARGUMENTS and then center the screen." (apply function arguments) -- cgit v1.2.3