From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 cPnsA1Qj7WODEAEAbAwnHQ (envelope-from ) for ; Wed, 15 Feb 2023 19:24:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 4GP0A1Qj7WNYUAEAauVa8A (envelope-from ) for ; Wed, 15 Feb 2023 19:24:20 +0100 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 951732F898 for ; Wed, 15 Feb 2023 19:24:19 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=me.com header.s=1a1hai header.b=l1a2+zkh; dmarc=fail reason="SPF not aligned (relaxed)" header.from=me.com (policy=quarantine); 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1676485459; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=69V026g137a+bdhgz1uXLj5/8s1RBXHkW+AoOObNBAo=; b=pBme6cKA4Y9QVnVVq3vythZ2SzijkX5O47/8rhyQE8rRjYAx+TuFXxx7a9jzwaU0pOpB1M QGddetDlhQ370YxQ9AL32KblOODa2WnkEB/tE9vJg9sJIu/NsSjessGEVI/fJM3j1kXUGC tKzsy9xMPGAi9FYV21/0scyCvTI+VkFg2dGiB4k6taoIoaI6SD9zYuch8qwk0XtxeLjkwb OnzaGxwOk1YZXhz5hxM8LTpV0rM8sAL/A+eXFpqqIdzCLmQnrJAzuy0NqPBOtZKCaRzq9V Ic9jxfysL4CP8CK/0Yt6JeHSHWu3TyVhOyV/WsUAKfX7oKaHlZsIYHWN242AVA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=me.com header.s=1a1hai header.b=l1a2+zkh; dmarc=fail reason="SPF not aligned (relaxed)" header.from=me.com (policy=quarantine); 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1676485459; a=rsa-sha256; cv=none; b=DctXi4TXCo0vqgqV+rUMrlwxxwRXDLsy7giz5D9kCiqw4WPzeCTTAfrMaDPBOlSoLMCkRU vo1iUPA8mnqkoCWP8SwMDb1wbZllb7bBbIj7LwEy12oy0IhI6EUOw5W95x267Tf6HKGeBj GquDw7WUhICR4b4uzGRJTA4OJWOWWad3//zPlwBeimDPDqQjJGrQbTBGJe7A0R7v8ULp50 cS75xU2Swr+9cuzoCG0FOobP6CrCOtLxn7Dllb0CUsuqmEfup/c+uwIfcLldg0VGZrheDV kjWgGidMF/xh+crTO7Z7I0DYd2Kzotee9iUEqwjkRs8tQUyuZM3m/FPlh+9WXQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSMQo-00084i-Dr; Wed, 15 Feb 2023 13:23:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSMQn-00084Y-GW for emacs-orgmode@gnu.org; Wed, 15 Feb 2023 13:23:01 -0500 Received: from pv50p00im-zteg10011401.me.com ([17.58.6.41]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSMQl-0000iE-RG for emacs-orgmode@gnu.org; Wed, 15 Feb 2023 13:23:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1676485374; bh=SYF97mG3B1rN5wRaaQxeeGuM8l59GzjSh3/zPvbhWE8=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=l1a2+zkh2QjhDFMq/mBvodct5Pj1Z/Pk/JuNiZfY+wLJICGvhkCYcSuFldROxBOht womEhPJCMjyA9y5WjGYS/Y7Ja3O1gAD8A5F5QPuhBLv5I11gh3U+GyYDKwaJ/y1sj5 Ls/+oLuxMMACO5uqUgkeYEB9yQjTJh6uEvlgEI318Fmc7Eay1aRLxVTOgN9GOL/J4X qM7YBFZlcTgnuzQzla8FUzQzQTrLR1tDZZVLZsRTJ6u1WwBkf8fDT8ZM32SlcMQhk+ ZwSi93eHnYjIE0PfMDdTHvKcdYrr5oJt7k9NnmYmD6/J99sjjkhXml5WcaAY/XHZB0 +KLDPFDLzRMrw== Received: from Rudolfs-MacBook-Air.local (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-zteg10011401.me.com (Postfix) with ESMTPSA id 104DFDC0695; Wed, 15 Feb 2023 18:22:52 +0000 (UTC) From: Rudolf =?utf-8?Q?Adamkovi=C4=8D?= To: Max Nikulin , emacs-orgmode@gnu.org Subject: Re: [PATCH] ox-texinfo: Fix invalid syntax in Texinfo version detection code In-Reply-To: <8f58aaaf-638b-1338-f58a-41048fea8f6d@gmail.com> References: <20230206214216.64841-1-salutis@me.com> <2cae1646-a4ee-f856-d27e-0ee924aad4bc@gmail.com> <87357hfyyl.fsf@localhost> <8f58aaaf-638b-1338-f58a-41048fea8f6d@gmail.com> Date: Wed, 15 Feb 2023 19:22:49 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Proofpoint-GUID: TA8Gqw6dVLiJb4u0QDxN1QvBl5o84Nax X-Proofpoint-ORIG-GUID: TA8Gqw6dVLiJb4u0QDxN1QvBl5o84Nax X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.517,18.0.883,17.0.605.474.0000000_definitions?= =?UTF-8?Q?=3D2022-06-21=5F08:2022-06-21=5F01,2022-06-21=5F08,2020-01-23?= =?UTF-8?Q?=5F02_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 mlxscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2302150163 Received-SPF: pass client-ip=17.58.6.41; envelope-from=salutis@me.com; helo=pv50p00im-zteg10011401.me.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: X-Migadu-Queue-Id: 951732F898 X-Spam-Score: 6.00 X-Migadu-Spam-Score: 6.00 List-Post: X-Migadu-Scanner: scn0.migadu.com X-Spam: Yes X-Migadu-Spam: Yes List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-TUID: 9YMC6J8IVhcl --=-=-= Content-Type: text/plain Max Nikulin writes: > Since content of subr-x.el consists of `defsubst' definitions, likely it > is preferable to use > > (eval-when-compile (require 'subr-x)) All right, I added the 'require' to both files. Better? Rudy --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-ox-texinfo-Fix-invalid-syntax-in-Texinfo-version-det.patch >From 384515548a4eb790e9b947e484dd9da41bdece94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= Date: Mon, 6 Feb 2023 22:33:40 +0100 Subject: [PATCH] ox-texinfo: Fix invalid syntax in Texinfo version detection code * lisp/ox-texinfo.el (org-texinfo-supports-math-p): Fix the incorrect syntax @displaymath{1 + 1 = 2} used to detect whether Texinfo supports TeX "math mode". Instead, use the correct syntax @math{1 + 1 = 2}. --- lisp/ox-texinfo.el | 16 ++++++++++------ testing/lisp/test-ox-texinfo.el | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index 8e3a04562..4ff482cc3 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -32,6 +32,8 @@ (require 'cl-lib) (require 'ox) +(eval-when-compile (require 'subr-x)) + (defvar orgtbl-exp-regexp) (defvar org-texinfo-supports-math--cache) @@ -2025,12 +2027,14 @@ Once computed, the results remain cached." (unless (boundp 'org-texinfo-supports-math--cache) (setq org-texinfo-supports-math--cache (let ((math-example "1 + 1 = 2")) - (let* ((input-file - (make-temp-file "test" nil ".info")) - (input-content - (concat (format "@setfilename %s" input-file) "\n" - "@node Top" "\n" - (format "@displaymath{%s}" math-example) "\n"))) + (let* ((input-file (make-temp-file "test" nil ".info")) + (input-content (string-join + (list (format "@setfilename %s" input-file) + "@node Top" + "@displaymath" + math-example + "@end displaymath") + "\n"))) (with-temp-file input-file (insert input-content)) (let* ((output-file (org-texinfo-compile input-file)) diff --git a/testing/lisp/test-ox-texinfo.el b/testing/lisp/test-ox-texinfo.el index 51fdb3606..38395500d 100644 --- a/testing/lisp/test-ox-texinfo.el +++ b/testing/lisp/test-ox-texinfo.el @@ -24,6 +24,8 @@ (require 'cl-lib) (require 'ox-texinfo) +(eval-when-compile (require 'subr-x)) + (unless (featurep 'ox-texinfo) (signal 'missing-test-dependency "org-export-texinfo")) @@ -292,5 +294,35 @@ nil '(:with-latex t)))))) + +;;; End-to-end + +(ert-deftest test-ox-texinfo/end-to-end-inline () + "Test end-to-end with inline TeX fragment." + (should + (org-test-with-temp-text + "$a^2 = b$" + (let ((export-buffer "*Test Texinfo Export*") + (org-export-show-temporary-export-buffer nil)) + (org-export-to-buffer 'texinfo export-buffer + nil nil nil nil nil + #'texinfo-mode))))) + +(ert-deftest test-ox-texinfo/end-to-end-sanity-check-displayed () + "Test end-to-end with LaTeX environment." + (should + (org-test-with-temp-text + (string-join + (list "\\begin{equation}" + "a ^ 2 = b" + "b ^ 2 = c" + "\\end{equation}") + "\n") + (let ((export-buffer "*Test Texinfo Export*") + (org-export-show-temporary-export-buffer nil)) + (org-export-to-buffer 'texinfo export-buffer + nil nil nil nil nil + #'texinfo-mode))))) + (provide 'test-ox-texinfo) ;;; test-ox-texinfo.el end here -- 2.39.0 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 "Chop your own wood and it will warm you twice." -- Henry Ford; Francis Kinloch, 1819; Henry David Thoreau, 1854 Rudolf Adamkovi=C4=8D [he/him] Studenohorsk=C3=A1 25 84103 Bratislava Slovakia --=-=-=--