emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Daniel Fleischer <danflscr@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Avoid ignoring LaTeX export output errors when org-latex-pdf-process is a list
Date: Thu, 26 May 2022 12:44:06 +0800	[thread overview]
Message-ID: <87o7zk6gyx.fsf@localhost> (raw)
In-Reply-To: <m2zgj9zegw.fsf@gmail.com>

Daniel Fleischer <danflscr@gmail.com> writes:

> Ihor Radchenko [2022-05-22 Sun 11:51] wrote:
>
>> The attached patch is fixing a rather annoying problem when
>> org-latex-pdf-process is set to a list. Currently, only output of the
>> last command in the list is preserved in *Org PDF LaTeX output* buffer,
>> which sometimes prevents ox-latex from detecting compilation warnings.
>
>> ox-latex relies on *Org PDF LaTeX output* to contain the output of latex
>> compiler. However, unless the last command in the org-latex-pdf-process
>> is something like pdflatex, the compiler errors are erased by
>> `shell-command' called by `org-compile-file'.
>
> Looks good. So the log buffer is going to be a concatenation of all the
> logs. Will ox-latex parse the longer log in a meaningful way?

ox-latex parses warnings according to org-latex--collect-warnings and
org-latex-known-warnings. It simply uses regular expressions.

By default, org-latex-pdf-process is using latexmk and will have no
issues. In theory, if the user adds some funny command outputting
warning/error-like string to org-latex-pdf-process, there might be a
confusing. But I see it as unlikely. The current behavior of keeping
only the last command output is worse, IMHO.

>  Is it just for the user to find issues by herself after a failed
> compilation?

It is orthogonal to the patch, but yes.
org-latex-compile does the following if it finds warnings/errors:

(let ((warnings (org-latex--collect-warnings log-buf)))
	(message (concat "PDF file produced"
			 (cond
			  ((eq warnings 'error) " with errors.")
			  (warnings (concat " with warnings: " warnings))
			  (t ".")))))

You just get a message indicating that there are some errors/warnings
(or even no message in some cases, when the proposed patch is not
applied).

Best,
Ihor



  reply	other threads:[~2022-05-26  4:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-22  3:51 [PATCH] Avoid ignoring LaTeX export output errors when org-latex-pdf-process is a list Ihor Radchenko
2022-05-22 17:03 ` Daniel Fleischer
2022-05-26  4:44   ` Ihor Radchenko [this message]
2022-05-23  8:53 ` Eric S Fraga
2022-05-24 15:16 ` Max Nikulin
2022-05-26  4:49   ` Ihor Radchenko
2022-07-31  7:36 ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o7zk6gyx.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=danflscr@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).