ox-latex: Remove unused argument

* lisp/ox-latex.el (org-latex-template,
org-latex-generate-engraved-preamble): The second argument of
`org-latex-generate-engraved-preamble' is only ever t, so there's not
much point in having it.

* lisp/ox-beamer.el (org-beamer-template): Update to not call
`org-latex-generate-engraved-preamble' with the second argument.
This commit is contained in:
TEC 2022-07-20 23:33:37 +08:00
parent 1061db94ac
commit 795783d644
No known key found for this signature in database
2 changed files with 33 additions and 38 deletions

View File

@ -875,7 +875,7 @@ holding export options."
(org-element-map (plist-get info :parse-tree) (org-element-map (plist-get info :parse-tree)
'(src-block inline-src-block) #'identity '(src-block inline-src-block) #'identity
info t)) info t))
(org-latex-generate-engraved-preamble info t)) (org-latex-generate-engraved-preamble info))
;; Document start. ;; Document start.
"\\begin{document}\n\n" "\\begin{document}\n\n"
;; Title command. ;; Title command.

View File

@ -1308,42 +1308,37 @@ which are given by `org-latex-engraved-preamble' and
"plaintop" "plain")) "plaintop" "plain"))
t t t t
engraved-preamble))) engraved-preamble)))
(if syntax-colours-p (concat
(concat "\n% Setup for code blocks [1/2]\n\n"
"\n% Setup for code blocks [1/2]\n\n" engraved-preamble
engraved-preamble "\n\n% Setup for code blocks [2/2]: syntax highlighting colors\n\n"
"\n\n% Setup for code blocks [2/2]: syntax highlighting colors\n\n" (if (require 'engrave-faces-latex nil t)
(if (require 'engrave-faces-latex nil t) (if engraved-themes
(if engraved-themes (concat
(concat (mapconcat
(mapconcat (lambda (theme)
(lambda (theme) (format
(format "\n\\newcommand{\\engravedtheme%s}{%%\n%s\n}"
"\n\\newcommand{\\engravedtheme%s}{%%\n%s\n}" (replace-regexp-in-string "[^A-Za-z]" "" theme)
(replace-regexp-in-string "[^A-Za-z]" "" theme) (replace-regexp-in-string
(replace-regexp-in-string "newcommand" "renewcommand"
"newcommand" "renewcommand" (replace-regexp-in-string
(replace-regexp-in-string "#" "##"
"#" "##" (funcall gen-theme-spec theme)))))
(funcall gen-theme-spec theme))))) engraved-themes
engraved-themes "\n")
"\n") "\n\n"
"\n\n" (cond
(cond ((memq engraved-theme engraved-themes)
((memq engraved-theme engraved-themes) (concat "\\engravedtheme"
(concat "\\engravedtheme" (replace-regexp-in-string
(replace-regexp-in-string "[^A-Za-z]" "" engraved-theme)
"[^A-Za-z]" "" engraved-theme) "\n"))
"\n")) (t (funcall gen-theme-spec engraved-theme))))
(t (funcall gen-theme-spec engraved-theme)))) (funcall gen-theme-spec engraved-theme))
(funcall gen-theme-spec engraved-theme)) (message "Cannot engrave source blocks. Consider installing `engrave-faces'.")
(message "Cannot engrave source blocks. Consider installing `engrave-faces'.") "% WARNING syntax highlighting unavailable as engrave-faces-latex was missing.\n")
"% WARNING syntax highlighting unavailable as engrave-faces-latex was missing.\n") "\n")))
"\n")
(concat
"\n% Setup for code blocks\n\n"
engraved-preamble
"\n"))))
;;;; Compilation ;;;; Compilation
@ -1999,7 +1994,7 @@ holding export options."
(org-element-map (plist-get info :parse-tree) (org-element-map (plist-get info :parse-tree)
'(src-block inline-src-block) #'identity '(src-block inline-src-block) #'identity
info t)) info t))
(org-latex-generate-engraved-preamble info t)) (org-latex-generate-engraved-preamble info))
;; Document start. ;; Document start.
"\\begin{document}\n\n" "\\begin{document}\n\n"
;; Title command. ;; Title command.