org-compile-file: Ensure whitespace before ERR-MSG

* lisp/org-macs.el (org-compile-file): Make sure that ERR-MSG has
lading whitespace and no trailing whitepace when displaying error.

Reported-by: Niall Dooley <dooleyn@gmail.com>
Link:
https://orgmode.org/list/CADS3Lq5Uv4gK0U93H2EX9r=g43BbhzHT33oXbWVg7bAURmFvFw@mail.gmail.com
This commit is contained in:
Ihor Radchenko 2023-05-25 13:55:44 +02:00
parent fa058f6d97
commit 93492b8619
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 7 additions and 1 deletions

View File

@ -396,7 +396,13 @@ it for output."
(when (bound-and-true-p org-batch-test)
(message "org-compile-file log ::\n-----\n%s\n-----\n"
(with-current-buffer log-buf (buffer-string))))
(error (format "File %S wasn't produced%s" output err-msg)))
(error
(format
"File %S wasn't produced%s"
output
(if (org-string-nw-p err-msg)
(concat " " (org-trim err-msg))
err-msg))))
output))
(defun org-compile-file-commands (source process ext &optional spec err-msg)