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

