From 3e3b873d3f863e890460dd655ae7fd5f5f0b88b5 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Tue, 18 Jul 2023 11:10:46 +0300 Subject: [PATCH] org-do-emphasis-faces: Make sure that 'invisible property is not sticky * lisp/org.el (org-do-emphasis-faces): Mark invisible text property in emphasis markers non-sticky. This is usually not a problem as we manage invisible text property via font-lock. However subtle bugs may exist with non-interactive calls to Elisp primitives that inherit text properties (like `indent-to'). Reported-by: Jens Schmidt Link: https://orgmode.org/list/8b691a7f-6b62-d573-e5a8-80fac3dc9bc6@vodafonemail.de --- lisp/org.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 3e60bb569..0d8b5386c 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5150,8 +5150,11 @@ stacked delimiters is N. Escaping delimiters is not possible." (not (org-at-comment-p))) (add-text-properties (match-end 4) (match-beginning 5) '(invisible t)) + ;; https://orgmode.org/list/8b691a7f-6b62-d573-e5a8-80fac3dc9bc6@vodafonemail.de + (org-rear-nonsticky-at (match-beginning 5)) (add-text-properties (match-beginning 3) (match-end 3) - '(invisible t))) + '(invisible t)) + (org-rear-nonsticky-at (match-end 3))) (throw :exit t)))))))) (defun org-emphasize (&optional char)