branch: externals/org
commit 570cdacdbf1c55adf4f66985e9db475db06e80b8
Author: Ihor Radchenko <[email protected]>
Commit: Ihor Radchenko <[email protected]>

    org-export-smart-quotes-alist: Turn into a custom option
    
    * lisp/ox.el (org-export-smart-quotes-alist): Change to `defcustom'.
    Fix typo in the value.  Add :type/:package-version/:group definitions.
    * etc/ORG-NEWS (~org-export-smart-quotes-alist~ is now a custom
    option): Announce the change.
    
    Link: https://orgmode.org/list/[email protected]
---
 etc/ORG-NEWS |  5 +++++
 lisp/ox.el   | 29 ++++++++++++++++++++++++++---
 2 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 6169dacf99..11fdf28255 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -305,6 +305,11 @@ setting the ~STYLE~ property for each sub-task.
 The change is breaking when ~org-use-property-inheritance~ is set to ~t~.
 
 ** New and changed options
+*** ~org-export-smart-quotes-alist~ is now a custom option
+
+Previously, smart quotes rules for different languages where
+hard-coded.  Now, they can be customized by users.
+
 *** Commands affected by ~org-fold-catch-invisible-edits~ can now be customized
 
 New user option ~org-fold-catch-invisible-edits-commands~ controls
diff --git a/lisp/ox.el b/lisp/ox.el
index 473bd927c6..5e757fd58a 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -5759,7 +5759,7 @@ transcoding it."
 ;; Dictionary for smart quotes is stored in
 ;; `org-export-smart-quotes-alist'.
 
-(defconst org-export-smart-quotes-alist
+(defcustom org-export-smart-quotes-alist
   '(("ar"
      (primary-opening
       :utf-8 "«" :html "&laquo;" :latex "\\guillemotleft{}"
@@ -5914,7 +5914,7 @@ transcoding it."
       :utf-8 "„" :html "&bdquo;" :latex "\\glqq{}" :texinfo "@quotedblbase{}")
      (secondary-closing
       :utf-8 "“" :html "&ldquo;" :latex "\\grqq{}" :texinfo "@quotedblleft{}")
-     (apostrophe :utf-8 "’" :html: "&#39;"))
+     (apostrophe :utf-8 "’" :html "&#39;"))
     ("sl"
      ;; Based on https://sl.wikipedia.org/wiki/Narekovaj
      (primary-opening :utf-8 "«" :html "&laquo;" :latex "{}<<"
@@ -5946,7 +5946,30 @@ A quote type can be any symbol among `primary-opening',
 Valid encodings include `:utf-8', `:html', `:latex' and
 `:texinfo'.
 
-If no translation is found, the quote character is left as-is.")
+If no translation is found, the quote character is left as-is."
+  :group 'org-export-general
+  :package-version '(Org . "9.7")
+  :type '(alist
+          :key-type
+          (string :tag "Language name")
+          :value-type
+          (alist
+           :key-type
+           (choice
+            (const :tag "Primary opening" primary-opening)
+            (const :tag "Primary closing" primary-closing)
+            (const :tag "Secondary opening" secondary-opening)
+            (const :tag "Secondary closing" secondary-closing)
+            (const :tag "Apostrophe" apostrophe))
+           :value-type
+           (plist
+            :key-type
+            (choice
+             (const :tag "UTF-8 ASCII translation" :utf-8)
+             (const :tag "HTML translation" :html)
+             (const :tag "LaTeX translation" :latex)
+             (const :tag "TeXInfo translation" :texinfo))
+            :value-type string))))
 
 (defun org-export--smart-quote-status (s info)
   "Return smart quote status at the beginning of string S.

Reply via email to