From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id KDgdBUCziWJDNwAAbAwnHQ (envelope-from ) for ; Sun, 22 May 2022 05:51:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id KA8PBUCziWJ3bgAA9RJhRA (envelope-from ) for ; Sun, 22 May 2022 05:51:28 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9872024B26 for ; Sun, 22 May 2022 05:51:27 +0200 (CEST) Received: from localhost ([::1]:59784 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nsccn-0008LS-TK for larch@yhetil.org; Sat, 21 May 2022 23:51:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38194) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nscbm-0008Kb-LI for emacs-orgmode@gnu.org; Sat, 21 May 2022 23:50:22 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:41773) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nscbk-0007aD-W2 for emacs-orgmode@gnu.org; Sat, 21 May 2022 23:50:22 -0400 Received: by mail-pj1-x102a.google.com with SMTP id l20-20020a17090a409400b001dd2a9d555bso10902542pjg.0 for ; Sat, 21 May 2022 20:50:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version; bh=J6JVx5oOL5wKZZvn59DsmpV7f+YyCPZAGnw70kDr8GM=; b=eDGUId9OacWDMNVQxbzZczbFVMGlkcasrNfAQt9PNOo/EOkBeeus2Ht2dzLLPSI/fS /0QsLI5bqR3FLuW5ExfFzggiKD5i5mPuJ/jxMVCkWFrDmwz0M8qu6/ALGZEgOuKqCBgf a9OqWPtduC3ERyd4LyTRiYcbEQG0yuA7hrplRRePwxUM7zdDLPA8uVrpWqBE8htgmyKb Kjy7BLYkzEOT82ScnyekcyvuSgqFeAJfpoft7ff7xw59cBjdaR+pbFx7e3071ZmZxPSl gx6d0EydOpbSym595EgWhvBQcr/77xuyWRp6XjpGWcDEc/Pe0GERj8E27ZFuTZvh73kD CdHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=J6JVx5oOL5wKZZvn59DsmpV7f+YyCPZAGnw70kDr8GM=; b=34bggvSgOooxnz2VAyctfgaEBu9JtktykybANarVrihua5uMktnQ87b4Al75tME9a1 kkMP/fYUfSbvT9hWYUVRWU2Yulf4Js3fVoF/QM8RyYbmIX4Ko4BSyiYhjAWjUcBi24x5 rTVGvi4GM69DM68F5fyh2hUGrHk6SsDA2fyxU1xwwVZcxSCBf6wwEidff75/q6faOS99 bhSz5sVWsbbP8JghjQuoAckRW9ixmE54naIaYoOmibX8tG8OkarbPY3rcXAUZK0HAEk2 Cu5Fze1q4WnAbssPSR6NRkPEcJM0pjziDOUBaCi8fBWjLnCySzabyXKXFArnImIXfvct SY5w== X-Gm-Message-State: AOAM531yuOIQDRa4nJuO/mvQdUAMaJC7kvm8dxbGkzDv0NRVW8ytqnXx 2fXyuYnUOtCkYjSa9YsYv5/oXF1aHhQQ/g== X-Google-Smtp-Source: ABdhPJzCOdHkaVVOZo8VwFEliIRfCsRiuVPExO8KrwvcdW/blpnRCOWbjuLLOgoaqQS+ZKWzxP3gSg== X-Received: by 2002:a17:902:db06:b0:162:ed2:4e9e with SMTP id m6-20020a170902db0600b001620ed24e9emr3902426plx.76.1653191419128; Sat, 21 May 2022 20:50:19 -0700 (PDT) Received: from localhost ([64.32.23.62]) by smtp.gmail.com with ESMTPSA id i13-20020a056a00224d00b00518382bceaesm4435648pfu.57.2022.05.21.20.50.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 May 2022 20:50:17 -0700 (PDT) From: Ihor Radchenko To: emacs-orgmode@gnu.org Subject: [PATCH] Avoid ignoring LaTeX export output errors when org-latex-pdf-process is a list Date: Sun, 22 May 2022 11:51:02 +0800 Message-ID: <87k0aep6mx.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=yantar92@gmail.com; helo=mail-pj1-x102a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653191487; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=J6JVx5oOL5wKZZvn59DsmpV7f+YyCPZAGnw70kDr8GM=; b=HhCbb3yTE5suNuFq8Ymqf6YJfyWpZa8BTVmFeRwA1h+UX+IaPGnxyQrCZcXc68GavwHSDs wNFCWsPeawQVrYum9vhiSqs+jB3jMsAqHcx0/8FNk0KLIbUpMK287MZ28dSV3RlsvTJluQ Ahx1Gd7XsjedvSEpJEpa4uN4LlW6gJ7vQfuVgjxIQoBwD+tbV4Wg6lsX37bv3Y2H3jZskl uN91Gj3Dz5/qoU672Ku80HOWmB0LCw2TSTLD8Ma7W+SOtwoRz+sSRYAINAV6xk32ALzNa0 pWmQk0Cct4Q0FHUGz+i7bqHURokKrznvwhzXWFNz4aezpkchZnKD3V1iq8ZhBw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653191487; a=rsa-sha256; cv=none; b=PkJNXpSA51CrXqmBlM9o3NdsULv5bh4o/zDMaYJSGRX5S7rqOlbVZ8JRDAhNxrTigbnjZC HXklBWyw5BL48LwMhh1PadnY1uuN4ztX+81KpIzYu0s83giY3d61FkbTRPcr3zJFbgYfkj StazsGp+nQNtmiXMnjMH1YmaY11GVXP+s1TuCX/Su12MfmcZHZ5LY5ISf5qDRPsREQ021o GY/T2Pc1MT1yFPUB1ypw6TFJ4gyed59G3l5CLbjgbxmOLcRtyu09w4b2agS+2NrF1JCR1E ClnRg7ToPx/wBzHbHkDheUSN1EFeFvmVk2PixXYQAUEjr/z6LFC6p+JHmrCNVg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=eDGUId9O; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -8.55 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=eDGUId9O; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 9872024B26 X-Spam-Score: -8.55 X-Migadu-Scanner: scn0.migadu.com X-TUID: 6Gczr0GTE4FP --=-=-= Content-Type: text/plain Hi, 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'. Best, Ihor --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Avoid-ignoring-LaTeX-export-output-errors.patch >From d4f15ed260f47195b01cb60061b57823428d2eef Mon Sep 17 00:00:00 2001 Message-Id: From: Ihor Radchenko Date: Sun, 22 May 2022 11:44:56 +0800 Subject: [PATCH] Avoid ignoring LaTeX export output errors * lisp/org-macs.el (org-compile-file): When PROCESS is a list, keep output of all the listed commands, not just the last one. * lisp/ox-latex.el (org-latex-pdf-process): Clarify that the process output is parsed to detect compilation errors/warnings. --- lisp/org-macs.el | 9 +++++++-- lisp/ox-latex.el | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lisp/org-macs.el b/lisp/org-macs.el index 10eed2686..2a7131ded 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -323,8 +323,13 @@ (defun org-compile-file (source process ext &optional err-msg log-buf spec) (?F . ,(shell-quote-argument full-name)) (?o . ,(shell-quote-argument out-dir)) (?O . ,(shell-quote-argument output)))))) - (dolist (command process) - (shell-command (format-spec command spec) log-buf)) + ;; Combine output of all commands in PROCESS. + (with-current-buffer log-buf + (let (buffer-read-only) + (erase-buffer))) + (let ((shell-command-dont-erase-buffer t)) + (dolist (command process) + (shell-command (format-spec command spec) log-buf))) (when log-buf (with-current-buffer log-buf (compilation-mode))))) (_ (error "No valid command to process %S%s" source err-msg)))) ;; Check for process failure. Output file is expected to be diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 5a2de8afb..ed16ec46f 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -1426,6 +1426,9 @@ (defcustom org-latex-pdf-process "%latex -interaction nonstopmode -output-directory %o %f")) "Commands to process a LaTeX file to a PDF file. +The command output will be parsed to extract compilation errors and +warnings according to `org-latex-known-warnings'. + This is a list of strings, each of them will be given to the shell as a command. %f in the command will be replaced by the relative file name, %F by the absolute file name, %b by the file -- 2.35.1 --=-=-=--