Hello,

I think I found a bug where the condition for `org-src-fontify-natively`
in `org-src-fontify-meta-lines-and-blocks-1` wasn't handling the block
type.  `org-src-fontify-natively` says it should fontify src blocks
only, but the condition didn't have that constraint.  Attached is a
patch that adds in the constraint.

>From 2f1342ad5b13f75387f6a26f0c68aac054903bcc Mon Sep 17 00:00:00 2001
From: Nathaniel Nicandro <nathanielnican...@gmail.com>
Date: Thu, 6 Apr 2023 08:49:20 -0500
Subject: [PATCH] Handle block-type when checking `org-src-fontify-natively`

* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Only fontify
  natively for blocks of src type.
---
 lisp/org.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index a6b8a30..d6c5803 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5414,8 +5414,9 @@ (defun org-fontify-meta-lines-and-blocks-1 (limit)
 	     beg end-of-endline '(font-lock-fontified t font-lock-multiline t))
 	    (org-remove-flyspell-overlays-in beg bol-after-beginline)
 	    (org-remove-flyspell-overlays-in nl-before-endline end-of-endline)
-	    (cond
-	     (org-src-fontify-natively
+            (cond
+	     ((and org-src-fontify-natively
+                   (string= block-type "src"))
 	      (save-match-data
                 (org-src-font-lock-fontify-block (or lang "") block-start block-end))
 	      (add-text-properties bol-after-beginline block-end '(src-block t)))
-- 
2.39.1

-- 
Nathaniel

Reply via email to