From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id yK3hIHI4+GBF3gAAgWs5BA (envelope-from ) for ; Wed, 21 Jul 2021 17:08:34 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id aAfEHHI4+GCHUwAAB5/wlQ (envelope-from ) for ; Wed, 21 Jul 2021 15:08:34 +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 E21401506 for ; Wed, 21 Jul 2021 17:08:33 +0200 (CEST) Received: from localhost ([::1]:52440 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6Dpo-00007r-Eo for larch@yhetil.org; Wed, 21 Jul 2021 11:08:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6DpA-00007c-VG for emacs-orgmode@gnu.org; Wed, 21 Jul 2021 11:07:52 -0400 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]:44634) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6Dp9-00084k-9I for emacs-orgmode@gnu.org; Wed, 21 Jul 2021 11:07:52 -0400 Received: by mail-pj1-x1036.google.com with SMTP id p4-20020a17090a9304b029016f3020d867so1217208pjo.3 for ; Wed, 21 Jul 2021 08:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:message-id :date:mime-version:content-transfer-encoding; bh=8pkjdXAodI6jnTiG+z56EucYn1NASfMAepvOfHuzKAU=; b=Ci+QFeWHg4NivYWw4aCTSrc5RBzVQtlYisEYxdRfgnNL0ebl1/PLOUjDvNlgYeFDwe XXQVDQvoA200yDXSE2AO/oADNXK+WeLJaAD/7nilGV/rDTyw4E4H0soF6YYmpJJ7+OVj 3AhkoYIoT/+eutSC5/QhMI8honyLxOBNk45RgYzfBcijiWLIbsklbqmSC3mXGC4Qj+be YZjYSS/4QSfLNxrgtGQXdr2+G7clPyedz0mu+zaJwVI0SHnV96Jljiy5tZa2neza9QcS q8Obb+YvfAkd2GjWotwRPotGDU1zLqk0XFXyMaEiX0RkHXKkGrUiVREp/QmEOQ5mhtUt azPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:message-id:date:mime-version:content-transfer-encoding; bh=8pkjdXAodI6jnTiG+z56EucYn1NASfMAepvOfHuzKAU=; b=i3Nq/FIuQjBS9WfTLwVPztgvuw1sUz+SdFEQ/Kyheop63dS7a5akJ0hty67ASXlXpe jE2qHFmXw/Zn9M0DuT2Qvogo5hn8VfjXABYC57EfwWEEqAfFw05Vp536xea6sPRTFhcD rDz77YDUWlt0q7XBn1JdFOGfcWNx3JHYD12ZTjt0btkV9I+ATQPqmR7K+UU3LdsKr/4r RPVBgrD7DoQgBzUbaPTPA6QvSIf43KCYJzkr/mKZ10gNMoRIKkOR9soxVvul4dshOU6e 1vOXjrFbwIXXwhkMuz4ZZdH7MdWwI8YD2B+/Bf2rIri26IFbx6Sczo1f7hb2qkD0OUvI 0yDw== X-Gm-Message-State: AOAM530zkBy2SLPKO7CEj0vwH5TijgNniT7E9HBfWywN48ARRIeRgP+/ Fu/lytwx96jbxoqB9Ddr+CY= X-Google-Smtp-Source: ABdhPJxEg6B+rIIL5SpJumHG3vj6Y0f5vvcXqn3zu+D88NHqRoqfcjxmbJIOu9i02wGWmb01ZGROyQ== X-Received: by 2002:a17:90a:d18d:: with SMTP id fu13mr4228899pjb.206.1626880069683; Wed, 21 Jul 2021 08:07:49 -0700 (PDT) Received: from localhost (180-150-91-8.b4965b.per.nbn.aussiebb.net. [180.150.91.8]) by smtp.gmail.com with ESMTPSA id 1sm28110819pfv.138.2021.07.21.08.07.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 08:07:49 -0700 (PDT) References: <43910853-03cb-c226-f46d-4736d0e6cca6@free.fr> <8735s8rld9.fsf@gmail.com> User-agent: mu4e 1.4.15; emacs 28.0.50 From: Timothy To: tbanelwebmin Subject: Re: [PATCH] bad table formula recorded in some cases In-reply-to: Message-ID: <87zgufr9ha.fsf@gmail.com> Date: Wed, 21 Jul 2021 23:07:45 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=tecosaur@gmail.com; helo=mail-pj1-x1036.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_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: , Cc: emacs-orgmode@gnu.org 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=1626880114; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=8pkjdXAodI6jnTiG+z56EucYn1NASfMAepvOfHuzKAU=; b=Sn3x+OXrVgkwCIn8ag/EZLlC0WW0ZxbCt+Bly4hZC4VCOAgjGoDFgpzpY0SsCwjB8QGXsg 6Zte+ebjcMBOf83oYc4Up+vmVG+4WwO4AKWbFpwHburpf5sKg+5FIMNhbomReMyTD/5Vbi u398G30YeiXlwvpgG4fPnvH1g+hnEZGqEZ74kiqD283PcfLa433ZKle7608kb6xLgB8uO+ 7n9aYN82mMYYE3NwdjDIIPYzcC9aaaV1kanwAeLnlzSYN8DDJCoiXL5VkcK5z77LlYbkxz eWsULbMaLZBmgbhd0D2P/MFBvHxxyeUIepxdZ2Hv1LnEvMbpyCwhDu1hnNBXbw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626880114; a=rsa-sha256; cv=none; b=HgLRmAXvVpVDQQU72brmsjGMScRtmQTZXUWzbiWhezXtE+jlxS2tFICewX3NdoR5mtiR1e rE4AyMH/8y22egZNna1zAba828t+829n8i8nHe0rMsRiBQSYNu4ne+dF/xF6VrvClKuP9P nnGvMgjyC7nCjqaXRDpuCQh4anj99LLyTB0yqDPqg0MCYJQ7H+s699mvrUYsowE1agM5Ik 12mwYZwhdvffu/hC7JoS4yIGz8aToS5VxECNJu4OjylGFphaVZmmDyZGk9mBdy2XyR5rta 4vULV7a6/DDov3sMBZnSW+m045piayGfvkBn//aQPJYRWOR7wQKYHCHAruyPRg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=Ci+QFeWH; 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: -1.61 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=Ci+QFeWH; 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: E21401506 X-Spam-Score: -1.61 X-Migadu-Scanner: scn0.migadu.com X-TUID: TGyvCIuzdLn+ Hi Thierry, tbanelwebmin writes: > I don't know the intention. But the answer may lie in the comment 4 > lines above: > ;; Don't overwrite TBLFM, we might use text properties to > ;; store stuff. > > In this case, the intention would be to keep the original "#+TBLFM:" > instead of inserting a fresh new one. > > But we are in the else branch of (if (looking-at ...)), which means > there was no "#+TBLFM:". And no text properties to save. Therefore we > may safely remove this (match-string 2). Thank you for looking into this, I'm reassured by your inference that this change is safe to make. I'm not really one of the main contribution-acceptors/pushers though, so I'd rather leave this for someone like Nicolas to sign off on. Would you mind bumping this thread in a few weeks if nothing happens? Hope that's not too much of an inconvenience, Timothy. > Le 21/07/2021 =C3=A0 12:50, Timothy a =C3=A9crit : >> Hi Thierry, >> >> Thanks for this! Looking at the change you suggest, do you know why the >> (match-string 2) bit might have been added in the first place? I'm just >> wondering if there might be some edge-case adversely affected by this --- >> hence trading one bug for another :P >> >> -- >> Timothy >> >> tbanelwebmin writes: >> >>> Small bug, small fix. >>> >>> Suppose we have a table embedded in a begin-end block. >>> >>> #+begin: aaa :param value >>> | a | b | >>> | a | b | >>> #+end: >>> >>> Suppose we want to add a formula, with C-c =3D >>> We end up with an incorrect result: >>> >>> #+begin: aaa :param value >>> | a | 33 | >>> | a | b | >>> :param value $2=3D33 >>> #+end: >>> >>> The fix: in org-table.el, line 2177, change >>> (insert (or (match-string 2) "#+TBLFM:"))) >>> to >>> (insert "#+TBLFM:")) >>> >>> Then we get the correct result: >>> >>> #+begin: aaa :param value >>> | a | 33 | >>> | a | b | >>> #+TBLFM: $2=3D33 >>> #+end: >>> >>> Why? Because (match-string 2) is supposed to refer to the (looking-at) >>> instruction 7 lines above. But (match-string 2) is in the else branch, >>> which means that (looking-at) failed. Therefore (match-string 2) returns >>> garbage. >>> >>> Thanks to Uwe Brauer for pointing to this bug.