[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 03543e17dd 2/2: org-src-font-lock-fontify-block: Tr
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 03543e17dd 2/2: org-src-font-lock-fontify-block: Transfer 'font-lock-face property |
Date: |
Tue, 19 Jul 2022 00:57:41 -0400 (EDT) |
branch: externals/org
commit 03543e17dd4a7eb0ed97bf87258ba825ffbc97f4
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>
org-src-font-lock-fontify-block: Transfer 'font-lock-face property
* lisp/org-src.el (org-src-font-lock-fontify-block): Copy
'font-lock-face text property in addition to 'face. This is required
because Emacs does not enable `font-lock-mode' inside buffers with
names starting from space character (Org fontification buffers are
such). Without `font-lock-mode' 'font-lock-face is not being remapped
to 'face text property and we may sometimes lose the information in
the major modes that do fontification by directly setting
'font-lock-face.
Reported in
https://teddit.net/r/orgmode/comments/w2b0tw/syntax_highlighting_in_orgsource_blocks/igqdx18/
---
lisp/org-src.el | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lisp/org-src.el b/lisp/org-src.el
index 59d8ee305a..b691817a7a 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -642,7 +642,12 @@ as `org-src-fontify-natively' is non-nil."
(while (setq next (next-property-change pos))
;; Handle additional properties from font-lock, so as to
;; preserve, e.g., composition.
- (dolist (prop (cons 'face font-lock-extra-managed-props))
+ ;; FIXME: We copy 'font-lock-face property explicitly because
+ ;; `font-lock-mode' is not enabled in the buffers starting from
+ ;; space and the remapping between 'font-lock-face and 'face
+ ;; text properties may thus not be set. See commit
+ ;; 453d634bc.
+ (dolist (prop (append '(font-lock-face face)
font-lock-extra-managed-props))
(let ((new-prop (get-text-property pos prop)))
(when new-prop
(put-text-property