From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id oKz/IV7892DycAAAgWs5BA (envelope-from ) for ; Wed, 21 Jul 2021 12:52:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id IEUJHl7892A3cAAA1q6Kng (envelope-from ) for ; Wed, 21 Jul 2021 10:52:14 +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 9B93A1C55D for ; Wed, 21 Jul 2021 12:52:13 +0200 (CEST) Received: from localhost ([::1]:36932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m69pk-0008Uh-Kg for larch@yhetil.org; Wed, 21 Jul 2021 06:52:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m69of-0008Q7-Aw for emacs-orgmode@gnu.org; Wed, 21 Jul 2021 06:51:05 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:43928) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m69od-0005lv-Ph for emacs-orgmode@gnu.org; Wed, 21 Jul 2021 06:51:05 -0400 Received: by mail-pl1-x635.google.com with SMTP id b12so745611plh.10 for ; Wed, 21 Jul 2021 03:51:03 -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; bh=ptdDnkYL+1x9v9LIE8qkHsGhPo0yHeUjevhxVriIpJk=; b=TfJqz75Gs46V5qYXMy17EC1M814VMsyzbqGfOdHbQMSMdoDemoppK3lj9MhxbHXED7 OkE9jm7/UdEV6UIPCGDos3lHm0U4ixkwhcQmtekDB+2Un0Nqx/rYcdBQF5GJIFSjHz7o ltUxdycrBaAa0jTHWWJQ2HAlVcEVZo4uZpkIl1BZMDtq2kb7ADs2+8VxFsvjPb/CeHo1 xQcyFizgrCTISFTaY7U6tV4CoiJzhXYpmGhdiojMb4l1CnwcQZsuQcEVZl/Cd51lSNwB uVXe1NbiKzj3mU8Ns5TQC7wVOdk13TEPJYrz0fcKb9KbFf54YDcqFeKPIjvmKRx85Kfh Lmzw== 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; bh=ptdDnkYL+1x9v9LIE8qkHsGhPo0yHeUjevhxVriIpJk=; b=QuHINQe2u2lqFhbE9qGpuB6dfQbmMhEfaNVe2boH8b3KTyOeyJg8DUts0x2ghoLI6q X1/qMNMlXeybeUR4XGK2hpC494j/Wg85lGYIQqbTA/45Fznu+tDKysdxuh44dy1Rri6W 2ToYLnpCqB7aQFWB8A+2PwFpxh4Ve7ljGrQ5Bgt7b17oC05IJ3ZxjTmkUynEm7594XqW ZLhxAov0gp8830mazcUvBdaoAEFwX/IOc0I9A5WNx64z+u9/5H1GgUll+v0a+jScTjOV JrYdA65ugr45OAgH7OAeyBoneQurrIdWn1VJiqqUcgvOzGO7vJkY9iB2zdeEKlJahBwG u5xQ== X-Gm-Message-State: AOAM531wMlXOmfSHp8MSO79aUyLRyPoXt5H+SeT0LrphRBTElc8XOxTc VWSoWyIAmOcN+3VNySTeGTE= X-Google-Smtp-Source: ABdhPJwmD5YeU5/Ea1kLFphARxH2WSxWFqpsxVgxXJnzwN6zXmfiw37rLDHD7cziiiyx1IcgqlScVQ== X-Received: by 2002:a17:902:c111:b029:12a:fc96:6513 with SMTP id 17-20020a170902c111b029012afc966513mr27512928pli.64.1626864662287; Wed, 21 Jul 2021 03:51:02 -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 f31sm29952540pgm.1.2021.07.21.03.51.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 03:51:02 -0700 (PDT) References: <43910853-03cb-c226-f46d-4736d0e6cca6@free.fr> 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: <43910853-03cb-c226-f46d-4736d0e6cca6@free.fr> Message-ID: <8735s8rld9.fsf@gmail.com> Date: Wed, 21 Jul 2021 18:50:59 +0800 MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=tecosaur@gmail.com; helo=mail-pl1-x635.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=1626864734; 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=ptdDnkYL+1x9v9LIE8qkHsGhPo0yHeUjevhxVriIpJk=; b=NZwbHxJaMMFnRIRtzACcWr9NfM67OYRRbIL2EFpThahkZ+s/DwEqqyj2KzU1ewAAIaqR8f /F4sWpOHmEXjrhvxEIJx4dnEYE2D7ZdZVsiHjB2CYvXtKAvoj3j8twnQCT6U71zJoWCXbG t3SYD29AStmB8Sp98RUsFGgHi2mnhwL0m3MZ4pogrbELmcUxuBwEyLGxA9tt+buw/eDQQM C0+M2a+h4q6cYbuladHl5D6PIGFubOrgVGTnm0aZotOBL+R3SUbJXpP516zBvvZ8VCVkuz u/ITv9biE4vQnlZnfOmePCdIWjKQMAuyJk/TjSeSeNCxXBHWQ0Q4hDCpxoPscw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626864734; a=rsa-sha256; cv=none; b=JugtoGlndaP2fai8WZFmUFa7vK2B4u6CWD43whHIy6i2UDzbpEFfrfpESOXS7be29aG1Uc VX9+uU6uRVkTTHUAZmicnrdW9SeHTFKACgDxIMWGkKb1YYqtIi9pSJ0dsrJdQb/dDZWafi Zvqqj7yP0NA43v1uk6+3uVbGydA8vGry5HD/iFffYo43c4Pw76AAFqu4I045rBuRLFIQiV keLVbtuZm8oNfJvkxqe4RXt0oI8r58qZhhNvomposbL9V9xgFQsY2F+1OmMJiVXLv+zynp ZrRaFa0OKkykgujxyoS1RCIY8qDFpwgGo7ehX73KxVvp4j7waaAtK+v2vZANjg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=TfJqz75G; 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.62 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=TfJqz75G; 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: 9B93A1C55D X-Spam-Score: -1.62 X-Migadu-Scanner: scn1.migadu.com X-TUID: j73ZAUwhh4HG 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 = > We end up with an incorrect result: > > #+begin: aaa :param value > | a | 33 | > | a | b | > :param value $2=33 > #+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=33 > #+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.