From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 6GHADmA5ZmBRggEAgWs5BA (envelope-from ) for ; Thu, 01 Apr 2021 23:21:36 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id eOOMCGA5ZmClAgAAB5/wlQ (envelope-from ) for ; Thu, 01 Apr 2021 21:21:36 +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 A0DC218559 for ; Thu, 1 Apr 2021 23:21:35 +0200 (CEST) Received: from localhost ([::1]:48898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lS4ku-0004wx-Q7 for larch@yhetil.org; Thu, 01 Apr 2021 17:21:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42286) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lS4kL-0004wk-97 for emacs-orgmode@gnu.org; Thu, 01 Apr 2021 17:20:57 -0400 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]:46777) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lS4kH-0003nr-3y for emacs-orgmode@gnu.org; Thu, 01 Apr 2021 17:20:56 -0400 Received: by mail-ed1-x52c.google.com with SMTP id h10so3470862edt.13 for ; Thu, 01 Apr 2021 14:20:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=5o+z2TsVMjDwxb2Xn05VJQI7J1vlYRvk5ioI49hxLRg=; b=qGXItcWQ7Mj14EDQ14vuapPhq1Xeab8x1EOnhP850bsKxhhc8TcXOdiWlXaoduCq2+ djvtEZD/ASn/BxryKN/gz62oyjAykHaVxki4VA2ZmbWcm8Sjxs/wjJDFD0EbWKEVFaDe czhnTav0+cVeoP8v6QT8bs044wVFG19TY04WRFvBX76/YOZWXAGOqNYExgPVY76qqCEx yinIeN8aWB4lSYlUNpAU84xDW+EnYTCEaaIqLivgPo3roSOgmKB2IQlEYLyOub7vyQpS FRykh/XIVr14HGtkoV709H5+AV76NAktU1xq1G0y5xipPdIl/Wk1ZLTyxrB0MhZxFhvR uM4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=5o+z2TsVMjDwxb2Xn05VJQI7J1vlYRvk5ioI49hxLRg=; b=lYmXXxtlIPbneVb89UM9o0hSz3ALK4BFucT06RfvKeU+n3LbZjC4seDFRPfHy67L8c qWbKX1L5JjsxqUB9X/HP+P5FfRlepjxXkoIKuy+GsAuK6cZvbXn5eM8nwK+OazrINnyg tmYh4u5oSuj3HTDFpzA96RaHB2cMk6JUhHslHo9tU+E7nJ8Jsf1O6Yh0mBtF+v/iNZWH YAZzBHpt3kUT+2LDJwkcIxpYNzShxx5TvrKyMwJwS8B7eb3GpWS3dIFJGKaaJ+Mo/hh4 fO/7EKh5tTlmHOHGGlj3cqIzBShniDCcD1oGgUvjNbRZxRZ6HU3pdby2oKD0qSwQgM7F GK0Q== X-Gm-Message-State: AOAM532cVm7E42RF3SaS9gs3+RbZrBW9FPt2d5bYxdNGiK8tfgKDYdy+ 0Ku/jH4O64ans6W6WIWT8jFZHeBRoUPOd9gMeDyaZlYaDU4WUg== X-Google-Smtp-Source: ABdhPJx5VwkPraPwK08kzv4cysEW4ku8p2V8eesh12L0htCQCRKA0U3GVnsdsSPlI/tgVSK/ZH1lLQ7fhBdd/Gd+Uo8= X-Received: by 2002:aa7:dd97:: with SMTP id g23mr12068350edv.154.1617312048903; Thu, 01 Apr 2021 14:20:48 -0700 (PDT) MIME-Version: 1.0 From: Peder Stray Date: Thu, 1 Apr 2021 23:20:37 +0200 Message-ID: Subject: Bug in formula updates when sorting table (and inserting hlines) To: emacs-orgmode@gnu.org Content-Type: multipart/alternative; boundary="0000000000002a786405beefceab" Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=peder.stray@gmail.com; helo=mail-ed1-x52c.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, HTML_MESSAGE=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=1617312095; 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=5o+z2TsVMjDwxb2Xn05VJQI7J1vlYRvk5ioI49hxLRg=; b=izTcgURX5hMm2SW46VdXHPsBcvv98jASc/w2JHcyIMDa0hlMDA5Rj533+uTxVbGxxkbyNV CMX8pDPOsRSaRTSUHNJOrvMz1xs1xcqtqDD9CuA/lVjsEyksKHu1zfpvojHynAhb+Iz8lS jCQQ3nMrK/3X49NzbXpBuIyN9ym3sXGif/z0JTE8hDphKKS9tJoU8tSBMXHS9dSfCQxqlB PbCEoYPSodFYNyKipsyNlTNAUUEf7PiMqohb4ePNodcT9pJvzzjjERRX+yN2qWYsJRGKR7 44iBZ2ttBQaymSpfyNgYNKdTD/aq3oBNvlH1kflBVRBQXwEh2TywBENW3Zfd8A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617312095; a=rsa-sha256; cv=none; b=roNWTrahJlfq11eufqiGwNkyDdnQV8iX7tC2Vq4S7QwlStmD4VyVA96VpvcIovcMZyttM6 /u/lCSNXfpvOfcFvl/T1TXkl4RueRkBTH/5O51gXH0z3BMX2uqOgyn7YqQUqIdh7W8y/fF UD2cvtYD9TcGWv+5a88+kMZrK5v+7GcgniCyHTtPjP5G6ZD8Sj6ekxukYyQU1uR99/ip8G 3XlD5DunYpWNAC9gSXT87GZMOjETfl/iQE3dTbAZ1mOJrHGf04QrnWdGPTyfNC8+MmDXJj YnLWuaRwoOQU4gke0OFHhnkOaOpy3ZYnVWvG5FMICILswL44oywlaGWFad+vbg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=qGXItcWQ; 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: -3.13 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=qGXItcWQ; 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: A0DC218559 X-Spam-Score: -3.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: CBNc8kMaqFpt --0000000000002a786405beefceab Content-Type: text/plain; charset="UTF-8" Hi! I have noticed a few times that sorting tables with C-c ^ does not update the formulas it contains. This has bitten me quite a bit, so it's good i have backups :) Here is a minimal example: | A | B | |----+---| | | 5 | | | 4 | | 8 | 3 | | 6 | 2 | | | 1 | |----+---| | 14 | | #+TBLFM: @4$1=@2$2+@4$2::@5$1=@3$2+@5$2::@7$1=vsum(@I..@II) Sorting in column B (between the hlines) with C-c ^ n, moves the lines around as you would expect, but notice that there are no changes in the TBLFM line. A C-u C-u C-c * after a sort should not change the values, but of course it does in this example. The TBLMF line should have been changed to:#+TBLFM: @4$1=@6$2+@4$2::@3$1=@5$2+@3$2::@7$1=vsum(@I..@II) One could also try adding a hline between the 8 and the 6 in the original table by typing C-c -, assuming no values in the table should change from it, the formula line should update @I..@II to @I..@III. I would really appreciate it if someone with more knowledge of the org-mode guts could have a look at this and come up with a solution :) -- Peder Stray --0000000000002a786405beefceab Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi!

I have noticed a few tim= es that sorting tables with C-c ^ does not update the formulas it contains.= =C2=A0 This has bitten me quite a bit, so it's good i have backups :)

Here is a minimal example:

|=C2=A0 A | B |
|----+---|
| =C2=A0=C2=A0 | 5 |
| =C2=A0=C2=A0 | 4 |
|=C2=A0 8 | 3 |
|=C2=A0 6 | 2 |
| =C2=A0=C2=A0 | 1 |
|----+---|
| 14 | =C2=A0 |
#+TBLFM: @4$1=3D@2$2+@4$2::@5$1=3D@3$2+@5$2::@7$1=3Dvsum(@I..@II)
=C2=A0
Sorting in column B (between t= he hlines) with C-c ^ n, moves the lines around as you would expect, but no= tice that there are no changes in the TBLFM line.=C2=A0 A C-u C-u C-c * aft= er a sort should not change the values, but of course it does in this examp= le. The TBLMF line should have been changed to:#+TBLFM:

@4$1=3D@6$2+@4$2::@3$1=3D@5$2+@3$2::@7$1=3Dvsum(@I..@II)

One could also try addi= ng a hline between the 8 and the 6 in the original table by typing C-c -, a= ssuming no values in the table should change from it, the formula line shou= ld update=C2=A0 @I..@II to @I..@III.

I would really appreciate it if someone with more knowledge of the org-mo= de guts could have a look at this and come up with a solution :)
<= div>
--
=C2=A0 Peder Stray
--0000000000002a786405beefceab--