|
| From: | stardiviner |
| Subject: | Re: [O] header argument :noweb-ref seems can't be resolved |
| Date: | Mon, 18 Dec 2017 10:08:47 +0800 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 |
The example I original copied from is Emacs org-mode info.
So I rewrite a hand typing content again:
```org
* Test
#+begin_src shell :tangle yes :noweb yes :shebang #!/bin/sh
<<fullest-disk>>
#+end_src
** the mount point of the fullest disk
:PROPERTIES:
:header-args: :noweb-ref fullest-disk
:END:
*** query all mount disks
#+begin_src shell
df \
#+end_src
*** strip the header row
#+begin_src shell
| sed '1d' \
#+end_src
*** output mount point of fullest disk
#+begin_src shell
| awk '{if (u < +$5) {u = +$5; m = $6}} END {print m}'
#+end_src
```
I can preview the first src block with [C-c C-v v] now. It is correct:
```shell
df \
| sed '1d' \
| awk '{if (u < +$5) {u = +$5; m = $6}} END {print m}'
```
I can tangle it with [C-c C-v t] to same file name shell script
`babel-noweb-ref.sh`.
But just can't run [C-c C-v e] or [C-c C-]. (Reports same error) Seems org-mode can find correct noweb-ref for tangle but can't for eval. On 12/18/2017 01:40 AM, Berry, Charles wrote:
On Dec 17, 2017, at 6:58 AM, stardiviner <address@hidden> wrote: I have the following org-mode file content: ```org #+begin_src shell :tangle yes :noweb yes :shebang #!/bin/sh <<fullest-disk>> #+end_src ** the mount point of the fullest disk :PROPERTIES: :header-args: :noweb-ref fullest-disk :END: *** query all mounted disksWhen I copied your ECM to a fresh org-buffer and typed `C-c C-v v' with point in the above src block I got an org babel preview buffer with nothing. Looking closely, I saw a character that was not visible in the gnus buffer from which I copied. Before the: PROPERITES: lines you have 32 160 32. 160 renders as a light brown underscore when I eval `(char-to-string 160)' on my MacPro, emacs 25.2.1. 32 is blank. Converting all three to blank. and Running `C-c C-v v' gives the contents of the src blocks under the noweb-ref headline. HTH, Chuck
| [Prev in Thread] | Current Thread | [Next in Thread] |