summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2016-08-29 00:45:07 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2016-08-29 00:45:07 +0200
commita9aad1c8e1c71ed7a2a3db656f9d24d81eb4dbe1 (patch)
tree2cb5130e00fd0eb64820a84003574fb0cd355079
parentd5b720fb1e96277b6bfe5781c5c27f14476c07cd (diff)
parent2dfdafd35afac6cdd8bdb6abd8a0bb05896345d2 (diff)
downloadorg-mode-a9aad1c8e1c71ed7a2a3db656f9d24d81eb4dbe1.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/org-table.el4
-rw-r--r--testing/lisp/test-org-table.el27
2 files changed, 29 insertions, 2 deletions
diff --git a/lisp/org-table.el b/lisp/org-table.el
index 2562f02..a8765b8 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -3194,8 +3194,8 @@ existing formula for column %s"
(re-search-forward org-table-hline-regexp end t)
(re-search-forward org-table-dataline-regexp end t))
(setq beg (match-beginning 0)))
- ;; Just leave BEG where it is.
- (t (setq beg (line-beginning-position)))))
+ ;; Just leave BEG at the start of the table.
+ (t nil)))
(setq beg (line-beginning-position)
end (copy-marker (line-beginning-position 2))))
(goto-char beg)
diff --git a/testing/lisp/test-org-table.el b/testing/lisp/test-org-table.el
index 6076d21..c4b5a4e 100644
--- a/testing/lisp/test-org-table.el
+++ b/testing/lisp/test-org-table.el
@@ -2009,6 +2009,33 @@ is t, then new columns should be added as needed"
| 4 | too large |
#+TBLFM: $2 = '(orgtbl-ascii-draw $1 0 3 3 \"$-\")")))
+(ert-deftest test-org-table/single-rowgroup ()
+ "Test column formula in a table with a single rowgroup."
+ (should
+ (equal
+ "
+|---+---|
+| 1 | 0 |
+|---+---|
+#+TBLFM: $2=$1-1"
+ (org-test-with-temp-text "
+|---+---|
+| 1 | |
+|---+---|
+<point>#+TBLFM: $2=$1-1"
+ (org-table-calc-current-TBLFM)
+ (buffer-string))))
+ (should
+ (equal
+ "
+| 1 | 0 |
+#+TBLFM: $2=$1-1"
+ (org-test-with-temp-text "
+| 1 | |
+<point>#+TBLFM: $2=$1-1"
+ (org-table-calc-current-TBLFM)
+ (buffer-string)))))
+
(provide 'test-org-table)