emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org-modern 246fb4cbe8 2/3: Better unfontify


From: ELPA Syncer
Subject: [elpa] externals/org-modern 246fb4cbe8 2/3: Better unfontify
Date: Thu, 15 Sep 2022 15:57:54 -0400 (EDT)

branch: externals/org-modern
commit 246fb4cbe887ca8f7e3898c21aa5f6836590f229
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Better unfontify
---
 org-modern.el | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/org-modern.el b/org-modern.el
index b7826e9e08..802a525fb9 100644
--- a/org-modern.el
+++ b/org-modern.el
@@ -705,23 +705,22 @@ the font.")
     (font-lock-add-keywords nil org-font-lock-keywords)
     (setq-local font-lock-unfontify-region-function #'org-unfontify-region)
     (remove-hook 'pre-redisplay-functions #'org-modern--pre-redisplay 'local)))
-  (with-silent-modifications
-    (save-restriction
-      (widen)
-      (org-modern--unfontify (point-min) (point-max))
-      (font-lock-flush))))
+  (save-restriction
+    (widen)
+    (with-silent-modifications
+      (org-modern--unfontify (point-min) (point-max)))
+    (font-lock-flush)))
 
 (defun org-modern--unfontify (beg end &optional _loud)
   "Unfontify prettified elements between BEG and END."
-  (org-unfontify-region beg end)
-  ;; TODO implement better unfontify
-  (with-silent-modifications
-    ;; Only remove line-prefix and wrap-prefix if org-indent-mode is disabled.
-    (remove-list-of-text-properties
-     beg end
-     (if (bound-and-true-p org-indent-mode)
-         '(display face invisible)
-       '(wrap-prefix line-prefix display face invisible)))))
+  (let ((font-lock-extra-managed-props
+         (append
+          ;; Only remove line-prefix and wrap-prefix if org-indent-mode is 
disabled.
+          (if (bound-and-true-p org-indent-mode)
+              '(display face invisible)
+            '(wrap-prefix line-prefix display face invisible))
+          font-lock-extra-managed-props)))
+    (org-unfontify-region beg end)))
 
 ;;;###autoload
 (defun org-modern-agenda ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]