From de5ce58331aa1f0ceab03e7dab42f82bdf709e4d Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sun, 22 Sep 2024 15:32:54 +0200 Subject: emacs: Add function to go from ts-mode to normal mode --- .config/emacs/init.el | 7 +++++++ 1 file changed, 7 insertions(+) (limited to '.config') diff --git a/.config/emacs/init.el b/.config/emacs/init.el index d5e4bd3..3794825 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -68,6 +68,13 @@ BODY directly after ‘(interactive)’." (string-remove-suffix "-mode" (symbol-name mode)) "-ts-mode"))) +(defun x-ts-mode-to-mode (ts-mode) + "Get the non-tree-sitter mode corresponding to TS-MODE." + (declare (pure t) (side-effect-free t)) + (intern (concat + (string-remove-suffix "-ts-mode" (symbol-name ts-mode)) + "-mode"))) + (defun x-string-split (separators string) "Wrapper around ‘string-split' that puts SEPARATORS first. This makes it convenient to use in ‘thread-last’." -- cgit v1.2.3