emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: D <d.williams@posteo.net>
To: Bastien <bzg@gnu.org>, emacs-orgmode@gnu.org
Subject: Re: Weird face behavior with org-hide-emphasis-markers enabled
Date: Wed, 12 Feb 2020 23:47:28 +0100	[thread overview]
Message-ID: <8f954105-a902-31b2-7871-c51faef3d7e7@posteo.net> (raw)
In-Reply-To: <43dbb209-04b1-b3d8-369d-0c95739727f7@posteo.net>

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.

  reply	other threads:[~2020-02-12 22:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-04 22:11 Weird face behavior with org-hide-emphasis-markers enabled D
2020-02-04 23:22 ` Bastien
2020-02-04 23:30   ` D
2020-02-12 17:24     ` Bastien
2020-02-12 18:19       ` D
2020-02-12 22:47         ` D [this message]
2020-02-12 23:11           ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8f954105-a902-31b2-7871-c51faef3d7e7@posteo.net \
    --to=d.williams@posteo.net \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).