"Charles C. Berry" <ccbe...@ucsd.edu> writes: > On Thu, 12 Jun 2014, Eric Schulte wrote: > >> Charles Berry <ccbe...@ucsd.edu> writes: >> >>> The following >>> >>> ,---- >>> | #+PROPERTY: tangle yes >>> | >>> | #+NAME: print-abc >>> | #+BEGIN_SRC emacs-lisp >>> | (format >>> | "<<%s>>" "abc") >>> | #+END_SRC >>> | >>> | #+NAME: print-def >>> | #+BEGIN_SRC emacs-lisp >>> | (concat >>> | "<<" "def" ">>") >>> | #+END_SRC >>> | >>> | #+BEGIN_SRC emacs-lisp :noweb yes >>> | <<print-abc>> >>> | <<print-def>> >>> | #+END_SRC >>> `---- >>> >>> >>> >>> tangles as >>> >>> ,---- >>> | (format >>> | "<<%s>>" "abc") >>> | >>> | (concat >>> | "<<" "def" ">>") >>> | >>> | (format >>> | "<<%s>>" "abc") >>> | (concat >>> | "") >>> `---- >>> >>> >>> Note that ""<<" "def" ">>" disappeared from (concat ...). >>> >>> FWIW, adding quotes inside the constant string in org-babel-noweb-wrap: >>> >>> >>> "\\([^ \"\t\n][^\"]+?[^ \"\t]\\|[^ \"\t\n]\\)" >>> >>> fixes this instance. >>> >> >> Does this raise any error, or fail silently? >> >> Thanks, >> Eric > > > Alas, it fails silently -- producing the erroneous output. > > I guess the issue is that > > `(re-search-forward (org-babel-noweb-wrap) nil t)' > > finds quoted expressions like > > 1. "<<abc>>" > 2. (concat "<<" abc ">>") > > FWIW, > > (re-search-forward > (org-babel-noweb-wrap > "\\([^ \"\t\n][^\"]+?[^ \"\t]\\|[^ \"\t\n]\\)" > ) nil t) > > (adding quotes to the [^...] bits) takes care of example 2. Not sure > if example 1 is a feature or a bug - I sometimes use things like > > "<<text-I-want>>" > > so maybe modifying the regex is good enough? > > OTOH, <<no-such-chunk>> has no effect. Maybe checking that the > reference actually resolves is better than tweaking the regexes. >
So it is currently possible to raise errors when noweb references don't resolve through the use of the `org-babel-noweb-error-all-langs' variable. I just added `org-babel-noweb-error-all-langs' which may be set to raise such errors regardless of the language of the code block. Best, Eric > > > HTH, > > Chuck > > -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D (see https://u.fsf.org/yw)