From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marco Wahl Subject: =?UTF-8?B?UmU6IEJ1Zzogb3JnLXRhYmxlLWluc2VydC1jb2x1bW4gZWRpdHMg?= =?UTF-8?B?Zm9ybXVsYXMgd3JvbmdseSBbOS4zIChyZWxlYXNlXzkuMyBAIC91c3IvbG9j?= =?UTF-8?B?YWwvQ2VsbGFyL2VtYWNzLXBsdXMvSEVBRC05ZDM4NTY0L3NoYXJlL2VtYWNz?= =?UTF-8?B?LzI4LjAuNTAvbGlzcC9vcmcvKV0=?= Date: Mon, 30 Mar 2020 23:38:37 +0200 Message-ID: <84eet9bk0y.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:44852) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJ27I-0003HZ-Uu for emacs-orgmode@gnu.org; Mon, 30 Mar 2020 17:38:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJ27H-0008C7-N9 for emacs-orgmode@gnu.org; Mon, 30 Mar 2020 17:38:44 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:33691) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJ27H-0008Am-Go for emacs-orgmode@gnu.org; Mon, 30 Mar 2020 17:38:43 -0400 Received: by mail-wr1-x42f.google.com with SMTP id a25so23558796wrd.0 for ; Mon, 30 Mar 2020 14:38:43 -0700 (PDT) In-Reply-To: (Yu Han Quek's message of "Tue, 31 Mar 2020 00:04:50 +0800") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: Yu Han Quek Cc: emacs-orgmode@gnu.org Yu Han Quek writes: > Calling org-table-insert-column in a table with formulas wrongly incremen= ts > the column number left of the newly inserted column. > > Minimal example: > > | 1 | 2 | 3 | > > #+TBLFM: $3=3D$1+$2 > > With cursor in the `1` cell, call `M-x org-table-insert-column`. > > Expected output: > > | 1 | | 2 | 3 | > > #+TBLFM: $4=3D$1+$3 > > Actual output ($1 wrongly changed to $2): > > | 1 | | 2 | 3 | > > #+TBLFM: $4=3D$2+$3 > > The bug seems to be in the last 2 lines of the > function org-table-insert-column: > > (org-table-fix-formulas "$" nil (1- col) 1) > (org-table-fix-formulas "$LR" nil (1- col) 1) > > Changing `(1- col)` to `col` solves the issue. Thanks. I committed your fix with the TINYCHANGE marker. I find it slightly suspicious that the documentation says #v+ =E2=80=98M-S-=E2=80=99 (=E2=80=98org-table-insert-column=E2=80=99) Insert a new column to the left of point position. #v- But actually the new column goes to the right and this is also fused by the tests. Has there been a stealth shift to the right? Anyway, I guess the documentation text should be updated as well. Any objections or comments about this? Ciao, -- Marco