Yu Han Quek <qyth...@gmail.com> 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