diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 6169dacf9..11fdf2825 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 473bd927c..5e757fd58 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 "«" :latex "\\guillemotleft{}" @@ -5914,7 +5914,7 @@ transcoding it." :utf-8 "„" :html "„" :latex "\\glqq{}" :texinfo "@quotedblbase{}") (secondary-closing :utf-8 "“" :html "“" :latex "\\grqq{}" :texinfo "@quotedblleft{}") - (apostrophe :utf-8 "’" :html: "'")) + (apostrophe :utf-8 "’" :html "'")) ("sl" ;; Based on https://sl.wikipedia.org/wiki/Narekovaj (primary-opening :utf-8 "«" :html "«" :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.