all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Patch: hiding emphasis markers
@ 2023-09-11 18:20 Tommy Phillips
  2024-09-01 14:49 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Tommy Phillips @ 2023-09-11 18:20 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/html, Size: 735 bytes --]

[-- Attachment #2: 0001-lisp-org.el-Only-hide-emphasis-markers-that-are-in-o.patch --]
[-- Type: application/octet-stream, Size: 1382 bytes --]

From e0ca6ad91afee63a015736026082937d97715418 Mon Sep 17 00:00:00 2001
From: Thomas Phillips <tphil98@gmail.com>
Date: Mon, 11 Sep 2023 19:02:50 +0100
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).

TINYCHANGE
---
 lisp/org.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 006f3688b..9ecf96c0d 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5157,7 +5157,8 @@ stacked delimiters is N.  Escaping delimiters is not possible."
 	      (add-text-properties (match-beginning 2) (match-end 2)
 				   '(font-lock-multiline t org-emphasis t))
 	      (when (and org-hide-emphasis-markers
-			 (not (org-at-comment-p)))
+			 (not (org-at-comment-p))
+			 (assoc marker org-emphasis-alist))
 		(add-text-properties (match-end 4) (match-beginning 5)
 				     '(invisible t))
                 ;; https://orgmode.org/list/8b691a7f-6b62-d573-e5a8-80fac3dc9bc6@vodafonemail.de
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: Patch: hiding emphasis markers
  2023-09-11 18:20 Patch: hiding emphasis markers Tommy Phillips
@ 2024-09-01 14:49 ` Ihor Radchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2024-09-01 14:49 UTC (permalink / raw)
  To: Tommy Phillips; +Cc: emacs-orgmode

Tommy Phillips <tphil98@gmail.com> writes:

> Here is a small suggested patch for the way org hides emphasis markers.
> It’s my first time doing this so hopefully I’m submitting it correctly.

Duplicate of https://list.orgmode.org/orgmode/CAAMEpPfGsCw+daVGX82-b6Qz3w-wiG1Ta6MpOzTn1tcJt4PmJQ@mail.gmail.com/

Canceled.

-- 
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>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-09-01 14:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-11 18:20 Patch: hiding emphasis markers Tommy Phillips
2024-09-01 14:49 ` Ihor Radchenko

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.