mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-12-27 10:55:04 +00:00
Merge branch 'maint'
This commit is contained in:
commit
79f75b77c4
@ -4996,7 +4996,8 @@ list of the fields in the rectangle."
|
|||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(if (re-search-forward
|
(if (re-search-forward
|
||||||
(concat "^[ \t]*#\\+tblname:[ \t]*" (regexp-quote name-or-id) "[ \t]*$")
|
(concat "^[ \t]*#\\+\\(tbl\\)?name:[ \t]*"
|
||||||
|
(regexp-quote name-or-id) "[ \t]*$")
|
||||||
nil t)
|
nil t)
|
||||||
(setq buffer (current-buffer) loc (match-beginning 0))
|
(setq buffer (current-buffer) loc (match-beginning 0))
|
||||||
(setq id-loc (org-id-find name-or-id 'marker))
|
(setq id-loc (org-id-find name-or-id 'marker))
|
||||||
|
@ -770,6 +770,24 @@ reference (with row). Mode string N."
|
|||||||
;; "Remote reference."
|
;; "Remote reference."
|
||||||
;; (should
|
;; (should
|
||||||
;; (string= "$3 = remote(FOO, @@#$2)" (org-table-convert-refs-to-rc "C& = remote(FOO, @@#B&)"))))
|
;; (string= "$3 = remote(FOO, @@#$2)" (org-table-convert-refs-to-rc "C& = remote(FOO, @@#B&)"))))
|
||||||
|
|
||||||
|
(ert-deftest test-org-table/remote-reference-access ()
|
||||||
|
"Access to remote reference."
|
||||||
|
(org-test-table-target-expect
|
||||||
|
"
|
||||||
|
#+NAME: table
|
||||||
|
| | 42 |
|
||||||
|
|
||||||
|
| replace | |
|
||||||
|
"
|
||||||
|
"
|
||||||
|
#+NAME: table
|
||||||
|
| | 42 |
|
||||||
|
|
||||||
|
| 42 | |
|
||||||
|
"
|
||||||
|
1 "#+TBLFM: $1 = remote(table, @1$2)"))
|
||||||
|
|
||||||
(ert-deftest test-org-table/org-at-TBLFM-p ()
|
(ert-deftest test-org-table/org-at-TBLFM-p ()
|
||||||
(org-test-with-temp-text-in-file
|
(org-test-with-temp-text-in-file
|
||||||
"
|
"
|
||||||
|
@ -239,15 +239,14 @@ get the table stable. Anyhow, if LAPS is 'iterate then iterate,
|
|||||||
but this will run one recalculation longer. When EXPECT is nil
|
but this will run one recalculation longer. When EXPECT is nil
|
||||||
it will be set to TARGET.
|
it will be set to TARGET.
|
||||||
|
|
||||||
If running a test interactively in ERT is not enough and you need
|
When running a test interactively in ERT is not enough and you
|
||||||
to examine the target table with e. g. the Org formula debugger
|
need to examine the target table with e. g. the Org formula
|
||||||
or an Emacs Lisp debugger (e. g. with point in a data field and
|
debugger or an Emacs Lisp debugger (e. g. with point in a data
|
||||||
calling the instrumented `org-table-eval-formula') then copy and
|
field and calling the instrumented `org-table-eval-formula') then
|
||||||
paste the table with formula from the ERT results buffer or
|
copy and paste the table with formula from the ERT results buffer
|
||||||
temporarily substitute the `org-test-with-temp-text' of this
|
or temporarily substitute the `org-test-with-temp-text' of this
|
||||||
function with `org-test-with-temp-text-in-file'.
|
function with `org-test-with-temp-text-in-file'. Also consider
|
||||||
|
setting `pp-escape-newlines' to nil manually."
|
||||||
Consider setting `pp-escape-newlines' to nil manually."
|
|
||||||
(require 'pp)
|
(require 'pp)
|
||||||
(let ((back pp-escape-newlines) (current-tblfm))
|
(let ((back pp-escape-newlines) (current-tblfm))
|
||||||
(unless tblfm
|
(unless tblfm
|
||||||
@ -256,9 +255,11 @@ Consider setting `pp-escape-newlines' to nil manually."
|
|||||||
(unless expect (setq expect target))
|
(unless expect (setq expect target))
|
||||||
(while (setq current-tblfm (pop tblfm))
|
(while (setq current-tblfm (pop tblfm))
|
||||||
(org-test-with-temp-text (concat target current-tblfm)
|
(org-test-with-temp-text (concat target current-tblfm)
|
||||||
;; Search table, stop ERT at end of buffer if not found.
|
;; Search the last of possibly several tables, let the ERT
|
||||||
|
;; test fail if not found.
|
||||||
|
(goto-char (point-max))
|
||||||
(while (not (org-at-table-p))
|
(while (not (org-at-table-p))
|
||||||
(should (eq 0 (forward-line))))
|
(should (eq 0 (forward-line -1))))
|
||||||
(when laps
|
(when laps
|
||||||
(if (and (symbolp laps) (eq laps 'iterate))
|
(if (and (symbolp laps) (eq laps 'iterate))
|
||||||
(should (org-table-recalculate 'iterate t))
|
(should (org-table-recalculate 'iterate t))
|
||||||
|
Loading…
Reference in New Issue
Block a user