forked from mirrors/org-mode
ox-texinfo: By default, use @samp instead of @verb for =...=
* lisp/ox-texinfo.el (org-texinfo-text-markup-alist): Change default value. (org-texinfo--text-markup): Handle protected @samp{...} command. @samp{} is more versatile than @verb{} as it can belong to more commands. So, it makes more sense as a default value.
This commit is contained in:
parent
f0f8ca730e
commit
fdac3c0140
|
@ -350,6 +350,10 @@ This variable is a ~defcustom~ and replaces the variable
|
||||||
~org-babel-capitalize-example-region-markers~, which is a ~defvar~ and
|
~org-babel-capitalize-example-region-markers~, which is a ~defvar~ and
|
||||||
is now obselete.
|
is now obselete.
|
||||||
*** =INCLUDE= keywords in commented trees are now ignored.
|
*** =INCLUDE= keywords in commented trees are now ignored.
|
||||||
|
*** Default value for ~org-texinfo-text-markup-alist~ changed.
|
||||||
|
|
||||||
|
Now ~=...=~ markup uses ~@samp{}~ instead of ~@verb{}~. You can use
|
||||||
|
~@verb{}~ again by customizing the variable.
|
||||||
|
|
||||||
* Version 9.0
|
* Version 9.0
|
||||||
|
|
||||||
|
|
|
@ -288,22 +288,24 @@ When nil, no transformation is made."
|
||||||
(defcustom org-texinfo-text-markup-alist '((bold . "@strong{%s}")
|
(defcustom org-texinfo-text-markup-alist '((bold . "@strong{%s}")
|
||||||
(code . code)
|
(code . code)
|
||||||
(italic . "@emph{%s}")
|
(italic . "@emph{%s}")
|
||||||
(verbatim . verb))
|
(verbatim . samp))
|
||||||
"Alist of Texinfo expressions to convert text markup.
|
"Alist of Texinfo expressions to convert text markup.
|
||||||
|
|
||||||
The key must be a symbol among `bold', `code', `italic',
|
The key must be a symbol among `bold', `code', `italic',
|
||||||
`strike-through', `underscore' and `verbatim'. The value is
|
`strike-through', `underscore' and `verbatim'. The value is
|
||||||
a formatting string to wrap fontified text with.
|
a formatting string to wrap fontified text with.
|
||||||
|
|
||||||
Value can also be set to the following symbols: `verb' and
|
Value can also be set to the following symbols: `verb', `samp'
|
||||||
`code'. For the former, Org will use \"@verb\" to create
|
and `code'. With the first one, Org uses \"@verb\" to create
|
||||||
a format string and select a delimiter character that isn't in
|
a format string and selects a delimiter character that isn't in
|
||||||
the string. For the latter, Org will use \"@code\" to typeset
|
the string. For the other two, Org uses \"@samp\" or \"@code\"
|
||||||
and try to protect special characters.
|
to typeset and protects special characters.
|
||||||
|
|
||||||
If no association can be found for a given markup, text will be
|
When no association is found for a given markup, text is returned
|
||||||
returned as-is."
|
as-is."
|
||||||
:group 'org-export-texinfo
|
:group 'org-export-texinfo
|
||||||
|
:version "26.1"
|
||||||
|
:package-version '(Org . "9.1")
|
||||||
:type 'alist
|
:type 'alist
|
||||||
:options '(bold code italic strike-through underscore verbatim))
|
:options '(bold code italic strike-through underscore verbatim))
|
||||||
|
|
||||||
|
@ -438,13 +440,12 @@ This is used to choose a separator for constructs like \\verb."
|
||||||
INFO is a plist used as a communication channel. See
|
INFO is a plist used as a communication channel. See
|
||||||
`org-texinfo-text-markup-alist' for details."
|
`org-texinfo-text-markup-alist' for details."
|
||||||
(pcase (cdr (assq markup org-texinfo-text-markup-alist))
|
(pcase (cdr (assq markup org-texinfo-text-markup-alist))
|
||||||
;; No format string: Return raw text.
|
(`nil text) ;no markup: return raw text
|
||||||
(`nil text)
|
(`code (format "@code{%s}" (org-texinfo--sanitize-content text)))
|
||||||
|
(`samp (format "@samp{%s}" (org-texinfo--sanitize-content text)))
|
||||||
(`verb
|
(`verb
|
||||||
(let ((separator (org-texinfo--find-verb-separator text)))
|
(let ((separator (org-texinfo--find-verb-separator text)))
|
||||||
(concat "@verb{" separator text separator "}")))
|
(format "@verb{%s%s%s}" separator text separator)))
|
||||||
(`code
|
|
||||||
(format "@code{%s}" (replace-regexp-in-string "[@{}]" "@\\&" text)))
|
|
||||||
;; Else use format string.
|
;; Else use format string.
|
||||||
(fmt (format fmt text))))
|
(fmt (format fmt text))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue