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 UOXaNTJEQGPMEAEAbAwnHQ (envelope-from ) for ; Fri, 07 Oct 2022 17:22:26 +0200 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 GHD2NTJEQGNnjwAAauVa8A (envelope-from ) for ; Fri, 07 Oct 2022 17:22:26 +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 94D942FD6F for ; Fri, 7 Oct 2022 17:22:26 +0200 (CEST) Received: from localhost ([::1]:50052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ogpBB-0007Si-Av for larch@yhetil.org; Fri, 07 Oct 2022 11:22:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59336) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ogoBT-0005bu-VA for emacs-orgmode@gnu.org; Fri, 07 Oct 2022 10:18:40 -0400 Received: from ci74p00im-qukt09081701.me.com ([17.57.156.6]:52831) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ogoBR-00042w-8A for emacs-orgmode@gnu.org; Fri, 07 Oct 2022 10:18:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1665152314; bh=ERsBiOj3Kpz7z7A20yER/zPcVkxs+/wvFtCtTicxYYs=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=pslu+4MPpfgEQAcqqH65qgnR0hVXHTGJmsP3kpgP56VCYWN8IRoyKuvyuAA2mUY2N uu8Y3GL4tnDT+6EisaRVbU7b2vK5ZgVsEA0T46eqyJ6/A6NGNWzdZxMKoaPKEMGLx0 qWHKc85H9rU1+mrPhHsqya6bDD4CgXhPHIweXUF8r78p5odBpcIFtVGlb2Cq1Xx1lv luSS7zu27BhIzi/rCJR08bu++g/ETZOx9wCphnmEzDKOQum3MyiA8sU+Nkwi4/kFO1 XY7I40rh1Wac6qhjO81aCXH+TDlCECJn22xQe5i0XNfRuGR6qFhAgjp7LKeGVfnLnd mXa8Wta++uiBw== Received: from Rudolfs-MacBook-Air.local (ci77p00im-dlb-asmtp-mailmevip.me.com [17.57.156.26]) by ci74p00im-qukt09081701.me.com (Postfix) with ESMTPSA id 2C1E146C02DD; Fri, 7 Oct 2022 14:18:32 +0000 (UTC) From: Rudolf =?utf-8?Q?Adamkovi=C4=8D?= To: Ihor Radchenko Cc: "Fraga, Eric" , "emacs-orgmode@gnu.org" Subject: Re: The Org mode in the Org Git does not export In-Reply-To: <87zge8j5iu.fsf@localhost> References: <87y1u7peo2.fsf@ucl.ac.uk> <871qrwgptv.fsf@localhost> <877d1nfxpj.fsf@localhost> <87a66iap48.fsf@localhost> <87o7uy5lng.fsf@localhost> <87edvs2qlj.fsf@localhost> <875ygwmc74.fsf@localhost> <87zge8j5iu.fsf@localhost> Date: Fri, 07 Oct 2022 16:18:30 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Proofpoint-ORIG-GUID: m-3Mhehr0LRg9KjoQM1VVifoOz8qNE5N X-Proofpoint-GUID: m-3Mhehr0LRg9KjoQM1VVifoOz8qNE5N X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.138,18.0.790,17.11.62.513.0000000_definitions?= =?UTF-8?Q?=3D2022-01-12=5F03:2020-02-14=5F02,2022-01-12=5F03,2021-12-02?= =?UTF-8?Q?=5F01_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=560 bulkscore=0 adultscore=0 spamscore=0 malwarescore=0 clxscore=1015 mlxscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210070086 Received-SPF: pass client-ip=17.57.156.6; envelope-from=salutis@me.com; helo=ci74p00im-qukt09081701.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, RCVD_IN_MSPIKE_H2=-0.001, 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: 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-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1665156146; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=ERsBiOj3Kpz7z7A20yER/zPcVkxs+/wvFtCtTicxYYs=; b=PQt1ycqOgaweqleT2TVNF9FNvksZ/QHuQiOGwuredBpPKIyJuVEJ8hIG3seowwxAManPwe j8u93VxbiQPT4xDunb5wfDo+45akyuEp1rPpD1z2KNQOdgp6etMqtO/ixzWHxQhZ/QFttz 0Wv2IbPvMhqnxBr6KzQRO6KLYHOjTrbr00jkt7cPBeotCwoFNjWR4t8E/P8a2wOTrc6G96 QnxiCoxYI3dREMLzNSygI2M5wpthjRNS6gObKZLRnPiNw45cEnRkV71cQOi1ax4dx7+vSg pndAKbCU1bSCyjXnaCuVj/Sn8+1sly6vX9Cm3bi8dYkF8DGiJGLbNuTf4tVmHw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665156146; a=rsa-sha256; cv=none; b=UZpzNwwzIYiJOJ8U3G6xTQgAQBFvauCzo8/UFCIHvs1cBhagWzebaFF0n2eiqciDlgN3Ao SXx7OhxOmUHRUYVKzCIHOixfu3olB2mCGQDU4ZMaTv0nvncal+eH3UtESFwqoPl+AVVOE8 N449tWsqFR0n++YGyzvMFDsp3lc9wZSi13FNh9eF+qqLZ41fN7UIe0vCnI5+ecYxwJH8Tl i0MBMKpUGIZw0idmOjmoWJhSINnoCAMPM4e0ySX/GCejOz2kRKxTsaWV0hSta6CUNvtyUQ WcoLOjTvJTMqjfHZiCh7Xle46AJbLBUp6Eo73D8vUAjNNpG4cdL+ELRnKHHe3g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=me.com header.s=1a1hai header.b=pslu+4MP; dmarc=pass (policy=quarantine) header.from=me.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: -3.97 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=me.com header.s=1a1hai header.b=pslu+4MP; dmarc=pass (policy=quarantine) header.from=me.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: 94D942FD6F X-Spam-Score: -3.97 X-Migadu-Scanner: scn1.migadu.com X-TUID: NxooaSGWGZHm --=-=-= Content-Type: text/plain Ihor Radchenko writes: > I do not see how it is related. Do you see the error with your config > or with clean Emacs? Good point. Just with my config. Ignoring for now! > Oops. Another side-effect of `buffer-file-name'. Fixed now. Thank you! >> (2) no corruption happens to the original file after export. > > Done. Superb! >> (1) re-opening the file after export always re-opens it, and > > I am not sure how to test this part. How about the attached patch? It mirrors the manual steps (find-file, export, kill-buffer, find-file), except it calls just the 'org-export-copy-buffer' procedure instead of exporting to HTML. The test fails without your fix and passes with it. Rudy --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-a-regression-test-for-org-export-copy-buffer.patch >From 8bc0f1e807df653634e77e5e5fc543a2e82191c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= Date: Fri, 7 Oct 2022 16:04:28 +0200 Subject: [PATCH] Add a regression test for 'org-export-copy-buffer' * testing/lisp/test-ox.el (test-org-export/org-export-copy-buffer): Make sure that 'find-file' after 'org-export-copy-buffer' re-opens the original file instead of the copy buffer. --- testing/lisp/test-ox.el | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el index 90a9eb3aa..60bf04316 100644 --- a/testing/lisp/test-ox.el +++ b/testing/lisp/test-ox.el @@ -63,20 +63,31 @@ variable, and communication channel under `info'." (ert-deftest test-org-export/org-export-copy-buffer () "Test `org-export-copy-buffer' specifications." - ;; The buffer copy must not cause overwriting the original file - ;; buffer under any circumstances. + ;; The copy must not overwrite the original file. (org-test-with-temp-text-in-file "* Heading" (let ((file (buffer-file-name))) (with-current-buffer (org-export-copy-buffer) - (insert "This must not go into actual file.") + (insert "This must not go into the original file.") (save-buffer) (should (equal "* Heading" (with-temp-buffer (insert-file-contents file) - (buffer-string)))))))) + (buffer-string))))))) + ;; The copy must not show when re-opening the original file. + (org-test-with-temp-text-in-file + "* Heading" + (let ((file (buffer-file-name))) + (with-current-buffer (org-export-copy-buffer) + (insert "This must not show as the original file.") + (save-buffer)) + (should + (equal "* Heading" + (with-temp-buffer + (find-file file) + (buffer-string))))))) (ert-deftest test-org-export/bind-keyword () "Test reading #+BIND: keywords." -- 2.37.3 --=-=-= 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 --=-=-=--