[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Weird face behavior with org-hide-emphasis-markers enabled
From: |
D |
Subject: |
Re: Weird face behavior with org-hide-emphasis-markers enabled |
Date: |
Wed, 12 Feb 2020 23:47:28 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 |
Hi,
After some I found the culprit! The issue arises from
org-do-emphasis-faces. The bug is caused by the line
(font-lock-prepend-text-property
(match-beginning 2) (match-end 2) 'face face)
which makes the surrounding "~"s part of the box, combined with
(add-text-properties (match-end 4) (match-beginning 5)
'(invisible org-link))
setting them invisible. This appears to confuse Emacs. Anything along
the lines of
(let ((num (if org-hide-emphasis-markers 4 2)))
(font-lock-prepend-text-property
(match-beginning num) (match-end num) 'face face))
should fix the issue.
To demonstrate the behavior, I created a MWE function reproducing the bug.
(defun mwe (start end)
"Reproduce a weird fontification behaviour cutting off boxes."
(interactive "r")
(font-lock-prepend-text-property
start end 'face '(:box (:line-width 3 :color "grey")))
(add-text-properties (1- end) end '(invisible org-link)))
Hope that is helpful,
D.