From: Ihor Radchenko <yantar92@posteo.net>
To: Tommy Phillips <tphil98@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Patch: hiding org emphasis markers
Date: Thu, 14 Sep 2023 12:47:38 +0000 [thread overview]
Message-ID: <87pm2kc45x.fsf@localhost> (raw)
In-Reply-To: <CAAMEpPfGsCw+daVGX82-b6Qz3w-wiG1Ta6MpOzTn1tcJt4PmJQ@mail.gmail.com>
Tommy Phillips <tphil98@gmail.com> writes:
> Here is a suggested small patch for how org hides emphasis markers.
> It's my first patch so hopefully I'm submitting it correctly.
The patch is ok. Thanks for submitting!
> Subject: [PATCH] lisp/org.el: Only hide-emphasis-markers that are in
> org-emphasis-alist
>
> * lisp/org.el (org-do-emphasis-faces): Add additional predicate to the
> 'and' clause that determines whether emphasis markers are hidden.
>
> Problem:
> Want to hide only the emphasis markers mentioned in org-emphasis-alist.
> After removing "underline" from org-emphasis-alist, '_underline_' is not underlined (correct behaviour), but the '_'s are hidden (incorrect behaviour).
Currently, `org-emphasis-alist' works independently from `org-hide-emphasis-markers'.
Your patch will constitute a breaking change for users who removed
entries from `org-emphasis-alist', but still expect the markers to be
hidden.
You may instead introduce a new allowed value for
`org-hide-emphasis-markers' to hide markers for non-nil entries in
`org-emphasis-alist'. Maybe even allow the value to be an explicit list
of the markers to be hidden '("*" "_" ...).
And do note that the effect of `org-emphasis-alist' is purely visual -
Org still considers entries removed from the alist as markup. It is just
the display in Org buffers that is changed.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
next prev parent reply other threads:[~2023-09-14 12:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-11 18:25 Patch: hiding org emphasis markers Tommy Phillips
2023-09-14 12:47 ` Ihor Radchenko [this message]
2023-10-15 9:05 ` Ihor Radchenko
2024-09-01 14:48 ` Ihor Radchenko
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=87pm2kc45x.fsf@localhost \
--to=yantar92@posteo.net \
--cc=emacs-orgmode@gnu.org \
--cc=tphil98@gmail.com \
/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).