branch: externals/org commit 66528468a1bcef05ee6feec894c559d796298ac1 Author: Ihor Radchenko <yanta...@gmail.com> Commit: Ihor Radchenko <yanta...@gmail.com>
org-src-font-lock-fontify-block: Do not transfer non-existing properties * lisp/org-src.el (org-src-font-lock-fontify-block): Never set font-lock properties when `get-text-property' returns nil. This usually means that the property is not present in the position property list. The old behavior could, for example, set 'invisible property to nil explicitly and prevent folding completely. Fixes https://list.orgmode.org/CA+G3_PN6RvcRcvN2fM=vfK1K6UsT=nNPJ7SUucmA1Ypc=em...@mail.gmail.com/T/#u --- lisp/org-src.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/org-src.el b/lisp/org-src.el index cc49181618..006217f70f 100644 --- a/lisp/org-src.el +++ b/lisp/org-src.el @@ -643,9 +643,10 @@ as `org-src-fontify-natively' is non-nil." ;; preserve, e.g., composition. (dolist (prop (cons 'face font-lock-extra-managed-props)) (let ((new-prop (get-text-property pos prop))) - (put-text-property - (+ start (1- pos)) (1- (+ start next)) prop new-prop - org-buffer))) + (when new-prop + (put-text-property + (+ start (1- pos)) (1- (+ start next)) prop new-prop + org-buffer)))) (setq pos next))) (set-buffer-modified-p nil)) ;; Add Org faces.