From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: Re: header argument :noweb-ref seems can't be resolved Date: Mon, 18 Dec 2017 10:08:47 +0800 Message-ID: References: <65580a97-24c4-a54c-655f-c37fcddd2cd1@gmail.com> <580C6094-17BE-44C7-8F4C-8BAF3113AA40@ucsd.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQkrR-0002ns-7B for emacs-orgmode@gnu.org; Sun, 17 Dec 2017 21:08:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eQkrN-0001VV-4T for emacs-orgmode@gnu.org; Sun, 17 Dec 2017 21:08:57 -0500 Received: from mail-pg0-x232.google.com ([2607:f8b0:400e:c05::232]:38432) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eQkrM-0001V2-TV for emacs-orgmode@gnu.org; Sun, 17 Dec 2017 21:08:53 -0500 Received: by mail-pg0-x232.google.com with SMTP id f12so8592089pgo.5 for ; Sun, 17 Dec 2017 18:08:52 -0800 (PST) In-Reply-To: <580C6094-17BE-44C7-8F4C-8BAF3113AA40@ucsd.edu> Content-Language: en-US List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: "Berry, Charles" Cc: emacs-org-mode 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 <> #+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 wrote: >> >> I have the following org-mode file content: >> >> ```org >> >> #+begin_src shell :tangle yes :noweb yes :shebang #!/bin/sh >> <> >> #+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 > >