emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: stardiviner <numbchild@gmail.com>
To: "Berry, Charles" <ccberry@ucsd.edu>
Cc: emacs-org-mode <emacs-orgmode@gnu.org>
Subject: Re: header argument :noweb-ref seems can't be resolved
Date: Mon, 18 Dec 2017 10:08:47 +0800	[thread overview]
Message-ID: <f57a4358-91e9-1bad-316b-b72ccde380ac@gmail.com> (raw)
In-Reply-To: <580C6094-17BE-44C7-8F4C-8BAF3113AA40@ucsd.edu>

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 <numbchild@gmail.com> 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 disks
>
> When 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
>
>

  reply	other threads:[~2017-12-18  2:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-17 14:58 header argument :noweb-ref seems can't be resolved stardiviner
2017-12-17 17:40 ` Berry, Charles
2017-12-18  2:08   ` stardiviner [this message]
2017-12-18  4:12     ` Berry, Charles
2017-12-18  4:28       ` stardiviner
2017-12-18 16:46         ` Berry, Charles
2017-12-18 17:28           ` numbchild
2017-12-19  4:59             ` Berry, Charles
2017-12-19  7:31               ` [BUG] " stardiviner
2017-12-19 17:49                 ` Berry, Charles
2017-12-19 19:00                   ` Nicolas Goaziou
2017-12-20  5:32                     ` Berry, Charles
2017-12-20 12:23                       ` Nicolas Goaziou
2017-12-20 15:41                         ` numbchild

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f57a4358-91e9-1bad-316b-b72ccde380ac@gmail.com \
    --to=numbchild@gmail.com \
    --cc=ccberry@ucsd.edu \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).