[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug: org-table-insert-column edits formulas wrongly [9.3 (release_9.
From: |
Marco Wahl |
Subject: |
Re: Bug: org-table-insert-column edits formulas wrongly [9.3 (release_9.3 @ /usr/local/Cellar/emacs-plus/HEAD-9d38564/share/emacs/28.0.50/lisp/org/)] |
Date: |
Mon, 30 Mar 2020 23:38:37 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Yu Han Quek <address@hidden> writes:
> Calling org-table-insert-column in a table with formulas wrongly increments
> the column number left of the newly inserted column.
>
> Minimal example:
>
> | 1 | 2 | 3 |
>
> #+TBLFM: $3=$1+$2
>
> With cursor in the `1` cell, call `M-x org-table-insert-column`.
>
> Expected output:
>
> | 1 | | 2 | 3 |
>
> #+TBLFM: $4=$1+$3
>
> Actual output ($1 wrongly changed to $2):
>
> | 1 | | 2 | 3 |
>
> #+TBLFM: $4=$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+
‘M-S-<RIGHT>’ (‘org-table-insert-column’)
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
- Bug: org-table-insert-column edits formulas wrongly [9.3 (release_9.3 @ /usr/local/Cellar/emacs-plus/HEAD-9d38564/share/emacs/28.0.50/lisp/org/)], Yu Han Quek, 2020/03/30
- Re: Bug: org-table-insert-column edits formulas wrongly [9.3 (release_9.3 @ /usr/local/Cellar/emacs-plus/HEAD-9d38564/share/emacs/28.0.50/lisp/org/)],
Marco Wahl <=
- Re: Bug: org-table-insert-column edits formulas wrongly [9.3 (release_9.3 @ /usr/local/Cellar/emacs-plus/HEAD-9d38564/share/emacs/28.0.50/lisp/org/)], Kyle Meyer, 2020/03/30
- Re: Bug: org-table-insert-column edits formulas wrongly [9.3 (release_9.3 @ /usr/local/Cellar/emacs-plus/HEAD-9d38564/share/emacs/28.0.50/lisp/org/)], Eric S Fraga, 2020/03/31
- Re: Bug: org-table-insert-column edits formulas wrongly [9.3 (release_9.3 @ /usr/local/Cellar/emacs-plus/HEAD-9d38564/share/emacs/28.0.50/lisp/org/)], Nicolas Goaziou, 2020/03/31
- Re: Bug: org-table-insert-column edits formulas wrongly [9.3 (release_9.3 @ /usr/local/Cellar/emacs-plus/HEAD-9d38564/share/emacs/28.0.50/lisp/org/)], Julius Dittmar, 2020/03/31
- Re: Bug: org-table-insert-column edits formulas wrongly [9.3 (release_9.3 @ /usr/local/Cellar/emacs-plus/HEAD-9d38564/share/emacs/28.0.50/lisp/org/)], Eric S Fraga, 2020/03/31
- Re: Bug: org-table-insert-column edits formulas wrongly [9.3 (release_9.3 @ /usr/local/Cellar/emacs-plus/HEAD-9d38564/share/emacs/28.0.50/lisp/org/)], Nicolas Goaziou, 2020/03/31