summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Wahl <marcowahlsoft@gmail.com>2020-03-30 23:23:33 +0200
committerMarco Wahl <marcowahlsoft@gmail.com>2020-03-30 23:23:33 +0200
commit31d1bf86a34976d5fdc4750057382f8703eab9a3 (patch)
treedd3eeece809a867a7cb7bcb2e06b2d840346058e
parentfffba5b7fdc6cc7b5d92cc31a1a2929fea86de96 (diff)
parentdc53b59a2562dd024646d0a20607b6ea36fe7abc (diff)
downloadorg-mode-31d1bf86a34976d5fdc4750057382f8703eab9a3.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/org-table.el4
-rw-r--r--testing/lisp/test-org-table.el10
2 files changed, 12 insertions, 2 deletions
diff --git a/lisp/org-table.el b/lisp/org-table.el
index 866abc2..fd5bc87 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -1368,8 +1368,8 @@ However, when FORCE is non-nil, create new columns if necessary."
;; Fix TBLFM formulas, if desirable.
(when (or (not org-table-fix-formulas-confirm)
(funcall org-table-fix-formulas-confirm "Fix formulas? "))
- (org-table-fix-formulas "$" nil (1- col) 1)
- (org-table-fix-formulas "$LR" nil (1- col) 1))))
+ (org-table-fix-formulas "$" nil col 1)
+ (org-table-fix-formulas "$LR" nil col 1))))
(defun org-table-find-dataline ()
"Find a data line in the current table, which is needed for column commands.
diff --git a/testing/lisp/test-org-table.el b/testing/lisp/test-org-table.el
index 565f3ff..14094de 100644
--- a/testing/lisp/test-org-table.el
+++ b/testing/lisp/test-org-table.el
@@ -2394,6 +2394,16 @@ See also `test-org-table/copy-field'."
(org-table-insert-column)
(buffer-string)))))
+(ert-deftest test-org-table/insert-column-with-formula ()
+ "Test `org-table-insert-column' with a formula in place."
+ (should
+ (equal "| 1 | | 1 | 2 |
+#+TBLFM: $4=$1+$3"
+ (org-test-with-temp-text
+ "| 1<point> | 1 | 2 |
+#+TBLFM: $3=$1+$2"
+ (org-table-insert-column)
+ (buffer-substring-no-properties (point-min) (point-max))))))
;;; Moving single cells