summaryrefslogtreecommitdiff
path: root/testing/examples/ob-header-arg-defaults.org
blob: 997152ef5974effc7ab70f70032837b113ec59cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#+TITLE: Tests for default header arguments to Babel source blocks
#+OPTIONS: ^:nil
#+PROPERTY: var  t1="go1" t3="go3_clobbered"
#+PROPERTY: var+ t2="go2" t3="go3"
#+PROPERTY: header-args  :var t1="gh1" t2="gh2_clobbered"
#+PROPERTY: header-args+ :var t4="gh4" t2="gh2" :var end=9
#+PROPERTY: header-args:emacs-lisp  :var t1="ge1" t4="ge4_clobbered"
#+PROPERTY: header-args:emacs-lisp+ :var t4="ge4" :var t5="ge5"
#+PROPERTY: header-args:emacs-lisp+ :results silent :noweb yes

#+NAME: showvar
#+BEGIN_SRC emacs-lisp :execute no
  (mapconcat (lambda (n)
               (let* ((n (string (+ 48 n)))
                      (p (intern (concat "t" n))))
                 (if (boundp p) (eval p) (concat "--" n))))
             (number-sequence 1 end)
             "/")
#+END_SRC

* Global property
  :PROPERTIES:
  :ID:       3fdadb69-5d15-411e-aad0-f7860cdd7816
  :END:

| Global                 | t1  | t2  | t3  | t4  | t5  | t6  | t7  | t8  | t9  |
|------------------------+-----+-----+-----+-----+-----+-----+-----+-----+-----|
| var property           | go1 | go2 | go3 | --- | --- | --- | --- | --- | --- |
| header-args            | gh1 | gh2 | --- | gh4 | --- | --- | --- | --- | --- |
| header-args:emacs-lisp | ge1 | --- | --- | ge4 | ge5 | --- | --- | --- | --- |
|------------------------+-----+-----+-----+-----+-----+-----+-----+-----+-----|
| Result                 | ge1 | gh2 | go3 | ge4 | ge5 | --6 | --7 | --8 | --9 |

#+CALL: showvar() :results silent
#+BEGIN_SRC emacs-lisp :var end=7
<<showvar>>
#+END_SRC

* Tree property
** Overwrite
  :PROPERTIES:
  :ID:       a9cdfeda-9f31-4bb5-b694-2cf452f07dfd
  :var: t6="to6"
  :header-args: :var t7="th7"
  :header-args:emacs-lisp: :var t8="te8"
  :header-args:emacs-lisp+: :results silent :noweb yes :var end=9
  :END:

| Global                 | t1  | t2  | t3  | t4  | t5  | t6  | t7  | t8  | t9  |
|------------------------+-----+-----+-----+-----+-----+-----+-----+-----+-----|
| var property           | go1 | go2 | go3 | --- | --- | --- | --- | --- | --- |
| header-args            | gh1 | gh2 | --- | gh4 | --- | --- | --- | --- | --- |
| header-args:emacs-lisp | ge1 | --- | --- | ge4 | ge5 | --- | --- | --- | --- |
|------------------------+-----+-----+-----+-----+-----+-----+-----+-----+-----|
| Tree                   | t1  | t2  | t3  | t4  | t5  | t6  | t7  | t8  | t9  |
|------------------------+-----+-----+-----+-----+-----+-----+-----+-----+-----|
| var property           | --- | --- | --- | --- | --- | to6 | --- | --- | --- |
| header-args            | --- | --- | --- | --- | --- | --- | th7 | --- | --- |
| header-args:emacs-lisp | --- | --- | --- | --- | --- | --- | --- | te8 | --- |
|------------------------+-----+-----+-----+-----+-----+-----+-----+-----+-----|
| Result #+CALL          | go1 | go2 | go3 | --4 | --5 | --- | th7 | te8 | --9 |
| Result noweb           | --1 | --2 | --3 | --4 | --5 | to6 | th7 | te8 | --9 |

#+CALL: showvar() :results silent
#+BEGIN_SRC emacs-lisp
<<showvar>>
#+END_SRC

** Accumulate
  :PROPERTIES:
  :ID:       1d97d258-fd50-4107-a095-e4625bffc57b
  :var+: t1="to1"
  :var+: t6="to6"
  :header-args+: :var t2="th2" t3="th3"
  :header-args:emacs-lisp+: :var t5="te5" end=8
  :END:

| Global                  | t1  | t2  | t3  | t4  | t5  | t6  | t7  | t8  | t9  |
|-------------------------+-----+-----+-----+-----+-----+-----+-----+-----+-----|
| var property            | go1 | go2 | go3 | --- | --- | --- | --- | --- | --- |
| header-args             | gh1 | gh2 | --- | gh4 | --- | --- | --- | --- | --- |
| header-args:emacs-lisp  | ge1 | --- | --- | ge4 | ge5 | --- | --- | --- | --- |
|-------------------------+-----+-----+-----+-----+-----+-----+-----+-----+-----|
| Tree                    | t1  | t2  | t3  | t4  | t5  | t6  | t7  | t8  | t9  |
|-------------------------+-----+-----+-----+-----+-----+-----+-----+-----+-----|
| var+ property           | to1 | --- | --- | --- | --- | to6 | --- | --- | --- |
| header-args+            | --- | th2 | th3 | --- | --- | --- | --- | --- | --- |
| header-args:emacs-lisp+ | --- | --- | --- | --- | te5 | --- | --- | --- | --- |
|-------------------------+-----+-----+-----+-----+-----+-----+-----+-----+-----|
| Result #+CALL           | ge1 | th2 | th3 | ge4 | te5 | --6 | --7 | --8 | --9 |
| Result noweb            | ge1 | th2 | th3 | ge4 | te5 | to6 | --7 | --8 | --9 |

#+CALL: showvar(end=6) :results silent
#+BEGIN_SRC emacs-lisp
<<showvar>>
#+END_SRC

** Complex
  :PROPERTIES:
  :ID:       fa0e912d-d9b4-47b0-9f9e-1cbb39f7cbc2
  :var: t1="to1"
  :var+: t6="to6"
  :header-args+: :var t2="th2"
  :header-args:emacs-lisp: :var t5="te5" end=7
  :header-args:emacs-lisp+: :results silent :noweb yes :var end=9
  :END:

| Global                 | t1  | t2  | t3  | t4  | t5  | t6  | t7  | t8  | t9  |
|------------------------+-----+-----+-----+-----+-----+-----+-----+-----+-----|
| var property           | go1 | go2 | go3 | --- | --- | --- | --- | --- | --- |
| header-args            | gh1 | gh2 | --- | gh4 | --- | --- | --- | --- | --- |
| header-args:emacs-lisp | ge1 | --- | --- | ge4 | ge5 | --- | --- | --- | --- |
|------------------------+-----+-----+-----+-----+-----+-----+-----+-----+-----|
| Tree                   | t1  | t2  | t3  | t4  | t5  | t6  | t7  | t8  | t9  |
|------------------------+-----+-----+-----+-----+-----+-----+-----+-----+-----|
| var property           | to1 | --- | --- | --- | --- | to6 | --- | --- | --- |
| header-args+           | --- | th2 | --- | --- | --- | --- | --- | --- | --- |
| header-args:emacs-lisp | --- | --- | --- | --- | te5 | --- | --- | --- | --- |
|------------------------+-----+-----+-----+-----+-----+-----+-----+-----+-----|
| Result #+CALL          | gh1 | th2 | go3 | gh4 | te5 | --6 | --7 | --8 | --9 |
| Result noweb           | gh1 | th2 | --3 | gh4 | te5 | to6 | --7 | --8 | --9 |

#+CALL: showvar(end=6) :results silent
#+BEGIN_SRC emacs-lisp
<<showvar>>
#+END_SRC