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/871qg5bnfh.fsf@bzg.fr
This commit is contained in:
Ihor Radchenko 2023-08-15 14:16:41 +03:00
parent 1d04af59b6
commit 570cdacdbf
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
2 changed files with 31 additions and 3 deletions

View File

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

View File

@ -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 "&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.