summaryrefslogtreecommitdiff
path: root/.config/emacs
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-09-09 22:37:03 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-09-09 22:37:03 +0200
commitf2d971cfe55cbfbeb1b67e43f11eb52c85e40db4 (patch)
treeca7d4c8066148ea05546819021abc6a2f51efd8b /.config/emacs
parent1065d29d7dbdd35f5cd539a975e847d537322178 (diff)
emacs: Add x-string-split
Diffstat (limited to '.config/emacs')
-rw-r--r--.config/emacs/init.el6
1 files changed, 6 insertions, 0 deletions
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)