ox: Make export errors more prominent

* lisp/ox-html.el (org-html-fontify-code):
* lisp/ox-latex.el (org-latex-generate-engraved-preamble):
(org-latex-inline-src-block):
(org-latex-src-block):
(org-latex-src--engrave-code):
* lisp/ox-odt.el:
(org-odt--table):
(org-odt--translate-latex-fragments):
(org-odt--export-wrap): Use `warn' instead of `message' when external
dependency/tool is missing/fails.
This commit is contained in:
Ihor Radchenko 2023-03-29 16:30:41 +02:00
parent e9110a8dd7
commit c1bb68ab9d
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
3 changed files with 16 additions and 16 deletions

View File

@ -2326,9 +2326,9 @@ is the language used for CODE, as a string, or nil."
((not org-html-htmlize-output-type) (org-html-encode-plain-text code))
;; No htmlize library or an inferior version of htmlize.
((not (progn (require 'htmlize nil t)
(fboundp 'htmlize-region-for-paste)))
(fboundp 'htmlize-region-for-paste)))
;; Emit a warning.
(message "Cannot fontify source block (htmlize.el >= 1.34 required)")
(warn "Cannot fontify source block (htmlize.el >= 1.34 required)")
(org-html-encode-plain-text code))
(t
;; Map language

View File

@ -1374,7 +1374,7 @@ which are given by `org-latex-engraved-preamble' and
"\n"))
(t (funcall gen-theme-spec engraved-theme))))
(funcall gen-theme-spec engraved-theme))
(message "Cannot engrave source blocks. Consider installing `engrave-faces'.")
(warn "Cannot engrave source blocks. Consider installing `engrave-faces'.")
"% WARNING syntax highlighting unavailable as engrave-faces-latex was missing.\n")
"\n")))
@ -2423,8 +2423,8 @@ contextual information."
(`engraved (org-latex-inline-src-block--engraved info code lang))
(`listings (org-latex-inline-src-block--listings info code lang))
(oldval
(message "Please update the LaTeX src-block-backend to %s"
(if oldval "listings" "verbatim"))
(warn "Please update the LaTeX src-block-backend to %s"
(if oldval "listings" "verbatim"))
(if oldval
(org-latex-inline-src-block--listings info code lang)
(org-latex--text-markup code 'code info))))))
@ -3321,8 +3321,8 @@ contextual information."
(`listings #'org-latex-src-block--listings)
((guard custom-env) #'org-latex-src-block--custom)
(oldval
(message "Please update the LaTeX src-block-backend to %s"
(if oldval "listings" "verbatim"))
(warn "Please update the LaTeX src-block-backend to %s"
(if oldval "listings" "verbatim"))
(if oldval
#'org-latex-src-block--listings
#'org-latex-src-block--verbatim)))
@ -3498,8 +3498,8 @@ to the Verbatim environment or Verb command."
(when lang-mode
(if (functionp lang-mode)
(funcall lang-mode)
(message "Cannot engrave code as %s. %s is undefined."
lang lang-mode)))
(warn "Cannot engrave code as %s. %s is undefined."
lang lang-mode)))
(engrave-faces-latex-buffer)))
(engraved-code
(with-current-buffer engraved-buffer

View File

@ -1009,7 +1009,7 @@ See `org-odt--build-date-styles' for implementation details."
(setq exit-code (archive-zip-extract archive member))
(buffer-string)))
(unless (zerop exit-code)
(message command-output)
(warn command-output)
(error "Extraction failed")))))
;;;; Target
@ -3413,7 +3413,7 @@ contextual information."
;; such tables from export.
(table.el
(prog1 nil
(message
(warn
(concat
"(ox-odt): Found table.el-type table in the source Org file."
" table.el doesn't support export to ODT format."
@ -3720,16 +3720,16 @@ contextual information."
(if (and (fboundp 'org-format-latex-mathml-available-p)
(org-format-latex-mathml-available-p))
(setq processing-type 'mathml)
(message "LaTeX to MathML converter not available.")
(warn "LaTeX to MathML converter not available. Falling back to verbatim.")
(setq processing-type 'verbatim)))
((dvipng imagemagick)
(unless (and (org-check-external-command "latex" "" t)
(org-check-external-command
(if (eq processing-type 'dvipng) "dvipng" "convert") "" t))
(message "LaTeX to PNG converter not available.")
(warn "LaTeX to PNG converter not available. Falling back to verbatim.")
(setq processing-type 'verbatim)))
(otherwise
(message "Unknown LaTeX option. Forcing verbatim.")
(warn "Unknown LaTeX option. Forcing verbatim.")
(setq processing-type 'verbatim)))
;; Store normalized value for later use.
@ -4089,8 +4089,8 @@ contextual information."
(error
;; Cleanup work directory and work files.
(funcall --cleanup-xml-buffers)
(message "OpenDocument export failed: %s"
(error-message-string err))))))
(warn "OpenDocument export failed: %s"
(error-message-string err))))))
;;;; Export to OpenDocument formula