mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-22 13:18:29 +00:00
Merge branch 'master' of orgmode.org:org-mode
This commit is contained in:
commit
68e1ededff
|
@ -365,7 +365,10 @@ Here is a call line with more than just the results exported.
|
||||||
:ID: cc5fbc20-bca5-437a-a7b8-2b4d7a03f820
|
:ID: cc5fbc20-bca5-437a-a7b8-2b4d7a03f820
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
If overriden by caller then use :var from header else use entry property.
|
Use case checked and documented with this test: During their
|
||||||
|
evaluation the source blocks read values from properties from the
|
||||||
|
entry where the call has been made unless the value is overridden with
|
||||||
|
the optional argument of the caller.
|
||||||
|
|
||||||
** section
|
** section
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
|
@ -375,10 +378,14 @@ If overriden by caller then use :var from header else use entry property.
|
||||||
|
|
||||||
Note: Just export of a property can be done with a macro: {{{property(a)}}}.
|
Note: Just export of a property can be done with a macro: {{{property(a)}}}.
|
||||||
|
|
||||||
#+CALL: src_block_location_shell(dummy_name="sect call")
|
#+NAME: src_block_location_shell sect call
|
||||||
#+CALL: src_block_location_elisp[:session sect call]()
|
#+CALL: src_block_location_shell()
|
||||||
- sect inline call_src_block_location_shell(dummy_name="sect inline")
|
|
||||||
- sect inline call_src_block_location_elisp[:session sect inline]()
|
#+NAME: src_block_location_elisp sect call
|
||||||
|
#+CALL: src_block_location_elisp()
|
||||||
|
|
||||||
|
- sect inline call_src_block_location_shell()
|
||||||
|
- sect inline call_src_block_location_elisp()
|
||||||
|
|
||||||
*** subsection
|
*** subsection
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
|
@ -386,20 +393,27 @@ Note: Just export of a property can be done with a macro: {{{property(a)}}}.
|
||||||
:c: 4
|
:c: 4
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
#+CALL: src_block_location_shell(dummy_name="sub0 call")
|
#+NAME: src_block_location_shell sub0 call
|
||||||
#+CALL: src_block_location_elisp[:session sub0 call]()
|
#+CALL: src_block_location_shell()
|
||||||
- sub0 inline call_src_block_location_shell(dummy_name="sub0 inline")
|
|
||||||
- sub0 inline call_src_block_location_elisp[:session sub0 inline]()
|
|
||||||
|
|
||||||
#+CALL: src_block_location_shell(dummy_name="sub1 call", c=5, e=6)
|
#+NAME: src_block_location_elisp sub0 call
|
||||||
#+CALL: src_block_location_elisp[:session sub1 call](c=5, e=6)
|
#+CALL: src_block_location_elisp()
|
||||||
- sub1 inline call_src_block_location_shell(dummy_name="sub1 inline", c=5, e=6)
|
|
||||||
- sub1 inline call_src_block_location_elisp[:session sub1 inline](c=5, e=6)
|
- sub0 inline call_src_block_location_shell()
|
||||||
|
- sub0 inline call_src_block_location_elisp()
|
||||||
|
|
||||||
|
#+NAME: src_block_location_shell sub1 call
|
||||||
|
#+CALL: src_block_location_shell(c=5, e=6)
|
||||||
|
|
||||||
|
#+NAME: src_block_location_elisp sub1 call
|
||||||
|
#+CALL: src_block_location_elisp(c=5, e=6)
|
||||||
|
|
||||||
|
- sub1 inline call_src_block_location_shell(c=5, e=6)
|
||||||
|
- sub1 inline call_src_block_location_elisp(c=5, e=6)
|
||||||
|
|
||||||
**** function definition
|
**** function definition
|
||||||
|
|
||||||
#+NAME: src_block_location_shell
|
#+NAME: src_block_location_shell
|
||||||
#+HEADER: :var dummy_name="workaround to get different result blocks"
|
|
||||||
#+HEADER: :var a=(or (org-entry-get org-babel-current-src-block-location "a" t) "0")
|
#+HEADER: :var a=(or (org-entry-get org-babel-current-src-block-location "a" t) "0")
|
||||||
#+HEADER: :var b=(or (org-entry-get org-babel-current-src-block-location "b" t) "0")
|
#+HEADER: :var b=(or (org-entry-get org-babel-current-src-block-location "b" t) "0")
|
||||||
#+HEADER: :var c=(or (org-entry-get org-babel-current-src-block-location "c" t) "0")
|
#+HEADER: :var c=(or (org-entry-get org-babel-current-src-block-location "c" t) "0")
|
||||||
|
|
|
@ -217,7 +217,6 @@ Here is one at the end of a line. =2=
|
||||||
(should-not (string-match (regexp-quote "i=\"10\"") result)))))
|
(should-not (string-match (regexp-quote "i=\"10\"") result)))))
|
||||||
|
|
||||||
(ert-deftest ob-exp/use-case-of-reading-entry-properties ()
|
(ert-deftest ob-exp/use-case-of-reading-entry-properties ()
|
||||||
:expected-result :failed ;; TODO: update for new call line result insertion
|
|
||||||
(org-test-at-id "cc5fbc20-bca5-437a-a7b8-2b4d7a03f820"
|
(org-test-at-id "cc5fbc20-bca5-437a-a7b8-2b4d7a03f820"
|
||||||
(org-narrow-to-subtree)
|
(org-narrow-to-subtree)
|
||||||
(let* ((case-fold-search nil)
|
(let* ((case-fold-search nil)
|
||||||
|
@ -227,27 +226,27 @@ Here is one at the end of a line. =2=
|
||||||
(sub1 "a:1, b:2, c:5, d:0, e:6")
|
(sub1 "a:1, b:2, c:5, d:0, e:6")
|
||||||
(func sub0))
|
(func sub0))
|
||||||
;; entry "section"
|
;; entry "section"
|
||||||
(should (string-match (concat "\"sect call\".*)\n: shell " sect "\n")
|
(should (string-match (concat "_shell sect call\n: shell " sect "\n")
|
||||||
result))
|
result))
|
||||||
(should (string-match (concat "sect call\\](.*)\n: elisp " sect "\n")
|
(should (string-match (concat "_elisp sect call\n: elisp " sect "\n")
|
||||||
result))
|
result))
|
||||||
(should (string-match (concat "\n- sect inline =shell " sect "=\n")
|
(should (string-match (concat "\n- sect inline =shell " sect "=\n")
|
||||||
result))
|
result))
|
||||||
(should (string-match (concat "\n- sect inline =elisp " sect "=\n")
|
(should (string-match (concat "\n- sect inline =elisp " sect "=\n")
|
||||||
result))
|
result))
|
||||||
;; entry "subsection", call without arguments
|
;; entry "subsection", call without arguments
|
||||||
(should (string-match (concat "\"sub0 call\".*)\n: shell " sub0 "\n")
|
(should (string-match (concat "_shell sub0 call\n: shell " sub0 "\n")
|
||||||
result))
|
result))
|
||||||
(should (string-match (concat "sub0 call\\](.*)\n: elisp " sub0 "\n")
|
(should (string-match (concat "_elisp sub0 call\n: elisp " sub0 "\n")
|
||||||
result))
|
result))
|
||||||
(should (string-match (concat "\n- sub0 inline =shell " sub0 "=\n")
|
(should (string-match (concat "\n- sub0 inline =shell " sub0 "=\n")
|
||||||
result))
|
result))
|
||||||
(should (string-match (concat "\n- sub0 inline =elisp " sub0 "=\n")
|
(should (string-match (concat "\n- sub0 inline =elisp " sub0 "=\n")
|
||||||
result))
|
result))
|
||||||
;; entry "subsection", call with arguments
|
;; entry "subsection", call with arguments
|
||||||
(should (string-match (concat "\"sub1 call\".*)\n: shell " sub1 "\n")
|
(should (string-match (concat "_shell sub1 call\n: shell " sub1 "\n")
|
||||||
result))
|
result))
|
||||||
(should (string-match (concat "sub1 call\\](.*)\n: elisp " sub1 "\n")
|
(should (string-match (concat "_elisp sub1 call\n: elisp " sub1 "\n")
|
||||||
result))
|
result))
|
||||||
(should (string-match (concat "\n- sub1 inline =shell " sub1 "=\n")
|
(should (string-match (concat "\n- sub1 inline =shell " sub1 "=\n")
|
||||||
result))
|
result))
|
||||||
|
|
Loading…
Reference in a new issue