From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aHkPNxSyn2BYfgEAgWs5BA (envelope-from ) for ; Sat, 15 May 2021 13:35:48 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id QEqsMhSyn2BIAQAAB5/wlQ (envelope-from ) for ; Sat, 15 May 2021 11:35:48 +0000 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 F05F6231AE for ; Sat, 15 May 2021 13:35:47 +0200 (CEST) Received: from localhost ([::1]:44768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhsaA-0000Rf-6z for larch@yhetil.org; Sat, 15 May 2021 07:35:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46594) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhsYG-0005VB-04 for emacs-orgmode@gnu.org; Sat, 15 May 2021 07:33:48 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:35458) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lhsYC-0003fG-S2 for emacs-orgmode@gnu.org; Sat, 15 May 2021 07:33:47 -0400 Received: by mail-wr1-x42a.google.com with SMTP id a4so1676624wrr.2 for ; Sat, 15 May 2021 04:33:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=ElnJa64QORxxdNJVoZf11ed9FyektBO0l2dBO5QKSWs=; b=hhlyTGSTSIZq1wdghOkxayGCG6we+QTfhi/cv6ZblRTQJaqblImAvoLgawU+EQ84GG RZDezFhU4fuGTBX2SmxV/70eu/uKobQ2YlJRfgd/5b2H+R7vRuTRn+ZvWQVSHXxjVp/m 2BWKbA5T2+C1k9JK/q98cEkMf9yhz7fXAoPvMEBPA/3hHPeJTxaNoWwB4jlB0tzelMOA pdEKUp7z6V5fbnr2WW/0vZLlosR5RnEAkyeFc0ZhKs6jmwC7mR4/H6NCXhOwBBccixNr 1yl7xuI0M2swl0+VpXFV+zsXLfs0aiW9dpkHNVaUneqyEGz8vczwnp5MQVR0JaFd/3bs JJ2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=ElnJa64QORxxdNJVoZf11ed9FyektBO0l2dBO5QKSWs=; b=XWVr2TkRfrXUfRamvOXr+atqxejThZD8YC8kNBFUr4qk0DDbcqCL+IQA/aT9V7c7SQ 222dDdrVxmp/hkzIzVtTBXPoXoCtg3WCxbmOP3PXtHhNaSRWzJ1o8RKgBn5GtOAUzyog oTYd5aGo+TKG6ufBg52tecjJveV+NO3nU8FASLl3+pcL3bmdsogQo2Itq2lxuhN9AK4o wyGTKwlZKN4VnuF62++fSV0Fhby0JqL52Ho4axmBrXByEfBvpFjvtdOXpJtbXkgLfi83 Y7rWT3LrEkERzz1Sgqb8YTQ1wju0aynroGZuIBN8Obb3pEt3Q1tLrOByrJCqztsSQIQZ pTvw== X-Gm-Message-State: AOAM530scO6eLvWpyrXu60v7qaQhMZbQXDj3B0zK5fIRQT8MA96mYDMT 3dN5k2GWT5WgiWhAQEj2cfgWjex02fZX0g== X-Google-Smtp-Source: ABdhPJx2tl/AgxOIh7vRC8l75D4ERLgV5PpR7gRl/QY/wu6Rb+R52nD5WIAxzEmW5wuywJd1t6ytPQ== X-Received: by 2002:a05:6000:24f:: with SMTP id m15mr5260567wrz.338.1621078422437; Sat, 15 May 2021 04:33:42 -0700 (PDT) Received: from localhost ([141.105.67.194]) by smtp.gmail.com with ESMTPSA id m9sm9224373wrq.78.2021.05.15.04.33.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 May 2021 04:33:41 -0700 (PDT) From: Ihor Radchenko To: emacs-orgmode@gnu.org Subject: [PATCH] Fix test-org-element/cache Date: Sat, 15 May 2021 19:38:34 +0800 Message-ID: <87wns0jkg5.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=yantar92@gmail.com; helo=mail-wr1-x42a.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1621078548; 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=ElnJa64QORxxdNJVoZf11ed9FyektBO0l2dBO5QKSWs=; b=jgDcuNx1EQ4wIDQ5FzOAOaP7kyjOUUvCFOUB/tPIPbfc7N1ffpEeYqbUN2evf0NPZC4VEH GqHKZpeKGAkcNafrTBqbCdiziJA5tbQ0qAp1grPzCuERo0bIRjOuJdISsV6lis7saIFfbP Ekf2XuVXaDdmGK59C41S6GBoTMxRnd/w1umpvN5+ahnwMtcnjaxztVIMy5PA8zjcrr6uez qtCyRskl/LCrjJsvkUGgb44ZkAq6TsBdPCaif71Q/DVzADBu85PUl6jp8VXtag7czYMcUe Q3RhBOsNBtWUCE9c6+tWyjgms/UzxJtOASC+F5QGbvNvyUVbCTS8y2ABzlO5tA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621078548; a=rsa-sha256; cv=none; b=WLTq+2fElYjBo1mnlZoMRx+1uGTCVS/9pCAumaYUpig14c0b2bsGDu9ke/KAGaYK+tyvgt nvOi1XHuMPn+6LnxmPqDsQmdi55BRWAX6O2O2rHHfufEy9RaNVK4Q0KQAAAndb00Cv0LAA uXkPgSaKPXRdhPgfLleEz0xu5y//33NqOET7dHr67xjxwQ8Qp/E4gTSVRxDP6MxEHmneaH GfhSALZ3PVGiDoIHsDFol7y0SYUSYMzsfE0wDku3i2Qag9/eWmpxTqi1pNUbCquTDDC9G/ mLAjrYl1OoZ21oAdpRkK0nh0Be/nqVc1z41/tJ6GQMHSo7Pb3E305niLLvw24g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=hhlyTGST; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.65 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=hhlyTGST; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: F05F6231AE X-Spam-Score: -2.65 X-Migadu-Scanner: scn0.migadu.com X-TUID: D3cyt4oRPu17 --=-=-= Content-Type: text/plain Hi, I encountered a bug in test-org-element/cache. The test creates the following Org file with table and runs (org-element-at-point) at the beginning of the second line. The expectation in the test is that we are at the table row, while in reality these are two distinct tables (the "ab" line is a table within "item" list entry): #+begin_center P0 - item P1 | a | b | | c | d | #+end_center I tested with emacs -Q (with no org-element-cache enabled). The return value of (org-element-at-point) is (table (...)). In the test (before inserting "item") the same point has different element: #+begin_center P0 P1 | a | b | | c | d | #+end_center Now, org-element-at-point (correctly) returns (table-row (...)). The master version of the test assumed that element would not change after modification (wrong). Yet, the test was passing with org-element-use-cache enabled (it should have not been). The current patch is fixing the test. Though I am not sure if it should be applied right now. The correct test will fail and org-element also need to be fixed. I do have a fix for org-element, but it is quite complex, not fully ready yet, involves other features, and needs to be discussed carefully. So, I am only submitting the patch for the test for now. Best, Ihor --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-test-org-element-cache-Preserve-local-structures.patch >From b9da1e2c4faeb5545fb43641209dd6eca80f5d51 Mon Sep 17 00:00:00 2001 Message-Id: From: Ihor Radchenko Date: Sat, 15 May 2021 19:19:09 +0800 Subject: [PATCH] Fix test-org-element/cache "Preserve local structures when re-parenting." * testing/lisp/test-org-element.el (test-org-element/cache): Add spaces to make the "abcd" table a single table. The old version uses example org text with two tables and was passing because of another bug in org-element-cache. Testing the old version with org-element-use-cache set to nil would yield error, while it should not. --- testing/lisp/test-org-element.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/lisp/test-org-element.el b/testing/lisp/test-org-element.el index 4f108754c..28e9ecd12 100644 --- a/testing/lisp/test-org-element.el +++ b/testing/lisp/test-org-element.el @@ -3770,7 +3770,7 @@ (ert-deftest test-org-element/cache () (eq 'table (let ((org-element-use-cache t)) (org-test-with-temp-text - "#+begin_center\nP0\n\n\n\n P1\n | a | b |\n| c | d |\n#+end_center" + "#+begin_center\nP0\n\n\n\n P1\n | a | b |\n | c | d |\n#+end_center" (save-excursion (search-forward "| c |") (org-element-at-point)) (insert "- item") (search-forward "| c |") -- 2.26.3 --=-=-=--