Hello, The latest in my visually-oriented (mostly) short patch series, adding basic fontification to inline export snippets --- @@comment:these things@@.
I think fontification for stuff like this is nice because it visually indicates to the user that they've written out an Org construct, and haven't just mis-remembered / imagined some syntax. In future this could be extended to use native fontification for recognised export formats (like src blocks do), but I think this is a nice improvement over nothing. -- Timothy
>From 3584602f88381ab9624c767a83c18cfd93ffeaf0 Mon Sep 17 00:00:00 2001 From: TEC <t...@tecosaur.com> Date: Wed, 31 Mar 2021 23:47:58 +0800 Subject: [PATCH] org: Add font-lock rule for inline export snippets * lisp/org.el (org-set-font-lock-defaults): Add font-lock rule for inline export snippets. --- lisp/org.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/org.el b/lisp/org.el index f4d069504..240f745c7 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5719,6 +5719,11 @@ (defun org-set-font-lock-defaults () ;; Description list items '("^[ \t]*[-+*][ \t]+\\(.*?[ \t]+::\\)\\([ \t]+\\|$\\)" 1 'org-list-dt prepend) + ;; Inline export snippets + '("\\(@@\\)\\([a-z-]+:\\).*?\\(@@\\)" + (1 'font-lock-comment-face t) + (2 'org-tag t) + (3 'font-lock-comment-face t)) ;; ARCHIVEd headings (list (concat org-outline-regexp-bol -- 2.30.1