Max Nikulin <maniku...@gmail.com> writes:

> Better docs and some restriction on defcustom values were discussed earlier:
> https://list.orgmode.org/87k0oyd3pw....@nicolasgoaziou.fr/
> Nicolas Goaziou. Re: Using backticks for the inline code delimeter? Mon, 
> 19 Apr 2021 11:27:07 +0200
>
> Sorry, I have not prepared a patch. I am not confident with defcustom 
> fine tuning and have not experimented with it since that time.

Maybe something like the attached?

Best,
Ihor

>From 8057cdb57f6600443b3605c1e7f00a30bea2a9ea Mon Sep 17 00:00:00 2001
Message-Id: <8057cdb57f6600443b3605c1e7f00a30bea2a9ea.1637048505.git.yanta...@gmail.com>
From: Ihor Radchenko <yanta...@gmail.com>
Date: Tue, 16 Nov 2021 15:40:35 +0800
Subject: [PATCH] org-emphasis-alist: Update defcustom making emphasis
 characters constant

* lisp/org.el (org-emphasis-alist): Mention that emphasis characters
should not be changed by user.  Update the defcustom type accordingly.
---
 lisp/org.el | 39 ++++++++++++++++++++++++++++++++++-----
 1 file changed, 34 insertions(+), 5 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 603b57279..7af5e26c6 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -3833,18 +3833,47 @@ (defcustom org-emphasis-alist
 marker characters and the face to be used by font-lock for highlighting
 in Org buffers.
 
+The characters in the alist must not be changed.  They do not affect
+the actual Org syntax, just fontification.
+
 You need to reload Org or to restart Emacs after customizing this."
   :group 'org-appearance
   :set 'org-set-emph-re
   :version "24.4"
   :package-version '(Org . "8.0")
-  :type '(repeat
+  :type '(list
 	  (list
-	   (string :tag "Marker character")
+	   (const "*")
+	   (choice
+	    (face :tag "Bold emphasis face")
+	    (plist :tag "Bold emphasis face property list")))
+          (list
+	   (const "/")
+	   (choice
+	    (face :tag "Italic emphasis face")
+	    (plist :tag "Italic emphasis face property list")))
+          (list
+	   (const "_")
+	   (choice
+	    (face :tag "Underline emphasis face")
+	    (plist :tag "Underline emphasis face property list")))
+          (list
+	   (const "=")
+	   (choice
+	    (face :tag "Verbatim emphasis face")
+	    (plist :tag "Verbatim emphasis face property list"))
+	   (const verbatim))
+          (list
+	   (const "~")
+	   (choice
+	    (face :tag "Code emphasis face")
+	    (plist :tag "Code emphasis face property list"))
+	   (const verbatim))
+          (list
+	   (const "+")
 	   (choice
-	    (face :tag "Font-lock-face")
-	    (plist :tag "Face property list"))
-	   (option (const verbatim)))))
+	    (face :tag "Strike-through emphasis face")
+	    (plist :tag "Strike-through emphasis face property list")))))
 
 (defvar org-protecting-blocks '("src" "example" "export")
   "Blocks that contain text that is quoted, i.e. not processed as Org syntax.
-- 
2.32.0

Reply via email to