doom

My literate doom emacs config
git clone https://github.com/michaelneuper/doom.git
Files | Log | Refs

commit cba70f8bdd155e18781bcbc38f64afb29fdac714
parent 09ecaf5ddc9448b29634743545e4f354e1533d74
Author: Michael Neuper <michael@michaelneuper.com>
Date:   Thu, 24 Jul 2025 20:48:31 +0200

add custom function for fixing filetag mistakes

Diffstat:
Mconfig.org | 24++++++++++++++++++++++++
1 file changed, 24 insertions(+), 0 deletions(-)

diff --git a/config.org b/config.org @@ -840,6 +840,30 @@ Customise =org= faces to for links and src blocks and scale headings. :foreground ,(face-attribute 'outline-5 :foreground) :weight medium))) #+end_src + +Make it easier to fix my mistakes. +#+begin_src emacs-lisp +(defun my/org-fix-filetags () + "Rewrite every `#+filetags:` directive in the current buffer so it uses the + canonical colon syntax, e.g. + #+filetags: tag1 tag2 -> #+filetags: :tag1:tag2:" + (interactive) + (save-excursion + (goto-char (point-min)) + (while (re-search-forward "^#\\+filetags:\\s-*\\(.*?\\)\\s-*$" nil t) + (let* ((line-beg (match-beginning 0)) + (line-end (match-end 0)) + (raw (match-string-no-properties 1)) + (tags (split-string raw "[: \t]+" t)) + (clean (concat "#+filetags: :" + (string-join tags ":") + ":"))) + (unless (equal (buffer-substring-no-properties line-beg line-end) clean) + (goto-char line-beg) + (delete-region line-beg line-end) + (insert clean)) + (forward-line 1))))) +#+end_src **** org-latex Use native highlighting for =LaTeX= related syntax in =org= buffers. By using native highlighting the =org-face= gets added which we want to avoid.