emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: [babel] ledger tutorial on Worg


From: Sébastien Vauban
Subject: [Orgmode] Re: [babel] ledger tutorial on Worg
Date: Thu, 02 Sep 2010 14:43:07 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Hi Eric(s) and Dan,

Eric S Fraga wrote:
> On Wed, 01 Sep 2010 13:25:35 +0200, Sébastien Vauban <address@hidden> wrote:
>>>>> I have just placed on Worg [1] a short tutorial/example for using
>>>>> ledger with babel.  Please have a look and comment etc!
>>>
>>> [1]  http://orgmode.org/worg/org-contrib/babel/languages.php#langs
>> 
>> Being interested a lot in Ledger integration with Org-Babel as well, I have a
>> quick remark: instead of including (with explicit full path) the journal
>> entries in every code block, can't we use the more natural (at least, to me)
>> tangling provided by the Noweb syntax?
>> 
>> Something like:
>> 
>> --8<---------------cut here---------------start------------->8---
>> * Journal data
>> 
>> #+src_name ledger-journal
>> #+begin_src ledger :results silent
>> 2008/01/03 * (SCORPIOS) SEB VAUBAN
>>      Assets:Bank:Checking:799979450003                               550.00 
>> EUR
>>      Assets:Bank:Transferred
>> 
>> 2008/01/01 * ( ) UNKNOWN-PAYEE
>>      Assets:Bank:Checking:799979450003                                21.91 
>> EUR
>>      Expenses:Unknown
>> #+end_src
>> 
>> * Balance
>> 
>> Give me an overview...
>> 
>> #+srcname: ledger-balance
>> #+begin_src ledger :cmdline "bal" :noweb
>> <<ledger-journal>>
>> #+end_src
>> --8<---------------cut here---------------end--------------->8---
>
> Yes, I would have thought that this would work. It doesn't fit in naturally
> with how I would like to do things as I have many different blocks of ledger
> entries spread around the file...

I don't understand your argument: why wouldn't you use <<journal-home>> blocks
and <<journal-work>> blocks for example, or even much more?  What am I missing?

What cannot be done with the noweb syntax in your Org file?  I find it much
better if we can avoid specifying explicit paths, in order to guarantee use
and execution of our Org files by other users, on other (even Windows)
machines, among others.


> In any case, I will try to see why this doesn't work as I have used
> the :noweb approach for other babel codes successfully and cannot see any
> reason why ledger would be different. Added to my todo list... :-)

Thanks...


>> Though this should work as far as I understand, it does not yet...

Dan very kindly spotted the following in my example:

> #+src_name ledger-journal
       ^
It looks like a random underscore crept in there.

Thanks...

True that it's a bit confusing to write src sometimes with underscores (as in
begin_src), sometimes not. But that's just a question of habit... Still newbie
as well...

Though, the following does not work yet:

--8<---------------cut here---------------start------------->8---
* Test with Org-Babel-Ledger

First evaluate this:

(org-babel-do-load-languages
 'org-babel-load-languages
 '((R . t)
   (emacs-lisp . t)
   (latex . t)
   (ledger . t)         ;this is the important one for this tutorial
   (sh . t)))

** Journal data

#+srcname ledger-journal
#+begin_src ledger
2008/01/03 * (SCORPIOS ) SEB VAUBAM
        Assets:Bank:Checking:799997400530                               550.00 
EUR
        Assets:Bank:Transferred

2008/01/01 * ( ) UNKNOWN-PAYEE
        Assets:Bank:Checking:799997400530                                21.91 
EUR
        Expenses:Unknown
#+end_src

** Balance

Give me an overview...

#+srcname: ledger-balance
#+begin_src ledger :cmdline bal :noweb yes :session
<<ledger-journal>>
#+end_src
--8<---------------cut here---------------end--------------->8---

failing with message

"Error: Failed to locate any transactions; did you specify a valid file with 
-f?"

in buffer "*Shell Command ...".

Thanks for the help you already provided to me!

Best regards,
  Seb

-- 
Sébastien Vauban




reply via email to

[Prev in Thread] Current Thread [Next in Thread]