emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* problems with INCLUDE, noweb and tangle
@ 2014-12-08 20:26 Daniele Pizzolli
  2014-12-09  9:33 ` Nicolas Goaziou
  0 siblings, 1 reply; 7+ messages in thread
From: Daniele Pizzolli @ 2014-12-08 20:26 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 431 bytes --]

Hello all,

The noweb reference in the included file is not present in tangle (and
sometimes also is not present within the results in the buffer).

I am using: Org-mode version 8.3beta release_8.3beta-625-g8985b3

Please see the attached ECM with my comments (look for BUG).  Let me
know if you want to have a look to the generated files.

You need ledger, but I guess this is a more general problem.

Thanks in advance,
Daniele


[-- Attachment #2: master.org --]
[-- Type: text/x-org, Size: 1960 bytes --]

#+EXPORT_EXCLUDE_TAGS: noexport

* Org Setup 							   :noexport:
#+NAME: loadledger
#+BEGIN_SRC emacs-lisp :results none
(org-babel-do-load-languages 'org-babel-load-languages '((ledger . t) ))
#+END_SRC

* Financial Summaries

** Inline Opening						   :noexport:
#+NAME: opening-inline
#+BEGIN_SRC ledger :noweb yes :results output silent :exports none
2015-01-01 * Opening
  Assets:bank:savings:inline  1.00 €
  Equity:Opening Balances
#+END_SRC

** Included Opening						   :noexport:
#+INCLUDE: "./included.org"

** An overall balance summary
#+name: balance
#+BEGIN_SRC ledger :noweb yes :exports results :cmdline bal :results output
<<opening-inline>>
<<opening-included>>
#+END_SRC

#+RESULTS: balance
:               1.00 €  Assets:bank:savings:inline
:              -1.00 €  Equity:Opening Balances
: --------------------
:                    0

** An overall balance summary with not working tangle

In this section the result in the export are correct, but the tangled
files contains only the =opening-inline= ref.  BUG?

#+name: tangled
#+BEGIN_SRC ledger :noweb yes :tangle ledger-buggy1.dat :results output :exports results
<<opening-inline>>
<<opening-included>>
#+END_SRC

#+RESULTS: tangled
:               1.00 €  Assets:bank:savings:inline
:              -1.00 €  Equity:Opening Balances
: --------------------
:                    0

** All the raw data

In this section the result:

- inline in the document =C-c C-c= are incorrect BUG?
- in the tangled files contain only the =opening-inline= ref. BUG?
- but in the exported file are correct

#+name: tangled-buggy
#+BEGIN_SRC ledger :noweb yes :tangle ledger-buggy2.dat :results output :exports results :cmdline print
<<opening-inline>>
<<opening-included>>
#+END_SRC

#+RESULTS: tangled-buggy
: 2015/01/01 * Opening
:     Assets:bank:savings:inline                1.00 €
:     Equity:Opening Balances


[-- Attachment #3: included.org --]
[-- Type: text/x-org, Size: 211 bytes --]

* Openings

#+NAME: opening-included
#+BEGIN_SRC ledger :noweb yes :results output silent :exports none
2015-01-01 * Opening
  Assets:bank:savings:included  -1.00 €
  Equity:Opening Balances
#+END_SRC

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: problems with INCLUDE, noweb and tangle
  2014-12-08 20:26 problems with INCLUDE, noweb and tangle Daniele Pizzolli
@ 2014-12-09  9:33 ` Nicolas Goaziou
  2014-12-09 10:55   ` Daniele Pizzolli
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Goaziou @ 2014-12-09  9:33 UTC (permalink / raw)
  To: Daniele Pizzolli; +Cc: emacs-orgmode

Hello,

Daniele Pizzolli <dan@toel.it> writes:

> The noweb reference in the included file is not present in tangle (and
> sometimes also is not present within the results in the buffer).

File inclusion, through INCLUDE keywords, is an export-only feature.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: problems with INCLUDE, noweb and tangle
  2014-12-09  9:33 ` Nicolas Goaziou
@ 2014-12-09 10:55   ` Daniele Pizzolli
  2014-12-09 11:06     ` Sebastien Vauban
  0 siblings, 1 reply; 7+ messages in thread
From: Daniele Pizzolli @ 2014-12-09 10:55 UTC (permalink / raw)
  To: emacs-orgmode

Hello Nicolas,

Nicolas Goaziou writes:

> Hello,
>
> Daniele Pizzolli writes:
>
>> The noweb reference in the included file is not present in tangle (and
>> sometimes also is not present within the results in the buffer).
>
> File inclusion, through INCLUDE keywords, is an export-only feature.

Thanks for the clarification.  I did not noticed that before.  I guess
that there is no plan to get this working for the general case, so the
only viable option is using one big .org file.

Best,
Daniele

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: problems with INCLUDE, noweb and tangle
  2014-12-09 10:55   ` Daniele Pizzolli
@ 2014-12-09 11:06     ` Sebastien Vauban
  2014-12-09 11:52       ` Daniele Pizzolli
  2014-12-09 12:55       ` ablepharus
  0 siblings, 2 replies; 7+ messages in thread
From: Sebastien Vauban @ 2014-12-09 11:06 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Daniele Pizzolli wrote:
> Hello Nicolas,
>
> Nicolas Goaziou writes:
>
>> Hello,
>>
>> Daniele Pizzolli writes:
>>
>>> The noweb reference in the included file is not present in tangle (and
>>> sometimes also is not present within the results in the buffer).
>>
>> File inclusion, through INCLUDE keywords, is an export-only feature.
>
> Thanks for the clarification.  I did not noticed that before.  I guess
> that there is no plan to get this working for the general case, so the
> only viable option is using one big .org file.

Or use the Library of Babel, if the code you wanna tangle gets
eventually used in many different files?

  ┌────
  │ 14.6 Library of Babel
  │ =====================
  │ 
  │ The “Library of Babel” consists of code blocks that can be called from
  │ any Org mode file.  Code blocks defined in the “Library of Babel” can be
  │ called remotely as if they were in the current Org mode buffer (see
  │ *note Evaluating code blocks:: for information on the syntax of remote
  │ code block evaluation).
  │ 
  │    The central repository of code blocks in the “Library of Babel” is
  │ housed in an Org mode file located in the ‘contrib’ directory of Org
  │ mode.
  │ 
  │    Users can add code blocks they believe to be generally useful to
  │ their “Library of Babel.” The code blocks can be stored in any Org mode
  │ file and then loaded into the library with ‘org-babel-lob-ingest’.
  │ 
  │    Code blocks located in any Org mode file can be loaded into the
  │ “Library of Babel” with the ‘org-babel-lob-ingest’ function, bound to
  │ ‘C-c C-v i’.
  └────

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: problems with INCLUDE, noweb and tangle
  2014-12-09 11:06     ` Sebastien Vauban
@ 2014-12-09 11:52       ` Daniele Pizzolli
  2014-12-09 13:10         ` Sebastien Vauban
  2014-12-09 12:55       ` ablepharus
  1 sibling, 1 reply; 7+ messages in thread
From: Daniele Pizzolli @ 2014-12-09 11:52 UTC (permalink / raw)
  To: emacs-orgmode


Hello Sebastien,

Sebastien Vauban writes:

>> Thanks for the clarification.  I did not noticed that before.  I guess
>> that there is no plan to get this working for the general case, so the
>> only viable option is using one big .org file.
>
> Or use the Library of Babel, if the code you wanna tangle gets
> eventually used in many different files?

Thanks, I was not aware of this option.  But it seems that the blocks
are statically added to the variable org-babel-library-of-babel, so when
I change the included files the changes does not propagate to the
library of babel automatically.  I also prefer a file based solution
rather than a global one.

Best,
Daniele

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: problems with INCLUDE, noweb and tangle
  2014-12-09 11:06     ` Sebastien Vauban
  2014-12-09 11:52       ` Daniele Pizzolli
@ 2014-12-09 12:55       ` ablepharus
  1 sibling, 0 replies; 7+ messages in thread
From: ablepharus @ 2014-12-09 12:55 UTC (permalink / raw)
  To: emacs-orgmode

Sebastien Vauban <sva-news@mygooglest.com> writes:

> Daniele Pizzolli wrote:

> Or use the Library of Babel, if the code you wanna tangle gets
> eventually used in many different files?
>

I tried that yesterday and ran into some trouble, I've set ":noweb yes"
for all C++ blocks in the files and it seems that lob does not pickup on
this and will not resolve noweb references. When referencing a lob src
block, the references in that block will not be resolved. I tried
setting ":noweb yes" in `org-babel-default-header-args´ and in
`org-babel-lob-header-args´ with no success.


Best regards,

max

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: problems with INCLUDE, noweb and tangle
  2014-12-09 11:52       ` Daniele Pizzolli
@ 2014-12-09 13:10         ` Sebastien Vauban
  0 siblings, 0 replies; 7+ messages in thread
From: Sebastien Vauban @ 2014-12-09 13:10 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Daniele Pizzolli wrote:
> Sebastien Vauban writes:
>
>>> Thanks for the clarification.  I did not noticed that before.  I guess
>>> that there is no plan to get this working for the general case, so the
>>> only viable option is using one big .org file.
>>
>> Or use the Library of Babel, if the code you wanna tangle gets
>> eventually used in many different files?
>
> Thanks, I was not aware of this option.  But it seems that the blocks
> are statically added to the variable org-babel-library-of-babel, so when
> I change the included files the changes does not propagate to the
> library of babel automatically.  I also prefer a file based solution
> rather than a global one.

The idea of the LOB is that it's a place where you put all the code
blocks you use in more than one file; you load the LOB, and the code
blocks are in memory -- known, so that you can reference them.

If you need to update them, the easiest is to directly edit them in (one
of) the (many) LOB file(s).

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-12-09 13:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-08 20:26 problems with INCLUDE, noweb and tangle Daniele Pizzolli
2014-12-09  9:33 ` Nicolas Goaziou
2014-12-09 10:55   ` Daniele Pizzolli
2014-12-09 11:06     ` Sebastien Vauban
2014-12-09 11:52       ` Daniele Pizzolli
2014-12-09 13:10         ` Sebastien Vauban
2014-12-09 12:55       ` ablepharus

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).