emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] "tangle" results of source blocks?
@ 2010-11-07 14:58 Maurizio Vitale
  2010-11-08 20:15 ` Sébastien Vauban
  2010-11-08 20:40 ` Eric Schulte
  0 siblings, 2 replies; 6+ messages in thread
From: Maurizio Vitale @ 2010-11-07 14:58 UTC (permalink / raw)
  To: emacs-orgmode

Hi,
  I have procmail rules defined in a org table which is then used as an
argument for an elisp block which produces procmailrc results.

Something like:

#+tblname: mailing-lists
| to      | emacs-users | emacs-users |
#+TBLFM: 


#+srcname: procmail-rules(mailing-lists=mailing-lists)
#+begin_src emacs-lisp :exports results :results output :tangle no
... elisp code that evaluates to procmail rules  
#+end_src

#+results: procmail-rules :tangle /tmp/YYY
:0:
* ^TO_emacs-users@XXX.com
$MAILDIR/emacs-users/

I'd like to tangle the result section, not the code block. Is that
possible?

Thanks,

        Maurizio

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

* Re: [babel] "tangle" results of source blocks?
  2010-11-07 14:58 [babel] "tangle" results of source blocks? Maurizio Vitale
@ 2010-11-08 20:15 ` Sébastien Vauban
  2010-11-08 21:15   ` Maurizio Vitale
  2010-11-08 20:40 ` Eric Schulte
  1 sibling, 1 reply; 6+ messages in thread
From: Sébastien Vauban @ 2010-11-08 20:15 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello Maurizio,

Maurizio Vitale wrote:
> Hi,
>   I have procmail rules defined in a org table which is then used as an
> argument for an elisp block which produces procmailrc results.
>
> Something like:
>
> #+tblname: mailing-lists
> | to      | emacs-users | emacs-users |
> #+TBLFM: 
>
> #+srcname: procmail-rules(mailing-lists=mailing-lists)
> #+begin_src emacs-lisp :exports results :results output :tangle no
> ... elisp code that evaluates to procmail rules  
> #+end_src
>
> #+results: procmail-rules :tangle /tmp/YYY
> :0:
> * ^TO_emacs-users-jE/qYTQ0Bw4@public.gmane.org
> $MAILDIR/emacs-users/
>
> I'd like to tangle the result section, not the code block. Is that
> possible?

See the "exports" header argument.

http://orgmode.org/manual/exports.html#exports

Best regards,
  Seb

-- 
Sébastien Vauban


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: [babel] "tangle" results of source blocks?
  2010-11-07 14:58 [babel] "tangle" results of source blocks? Maurizio Vitale
  2010-11-08 20:15 ` Sébastien Vauban
@ 2010-11-08 20:40 ` Eric Schulte
  2010-11-08 21:27   ` Maurizio Vitale
  1 sibling, 1 reply; 6+ messages in thread
From: Eric Schulte @ 2010-11-08 20:40 UTC (permalink / raw)
  To: Maurizio Vitale; +Cc: emacs-orgmode

Hi Maurizio,

You could try something like the following using the noweb expansion to
run the code block and tangle its results.

#+begin_src procmail :tangle yes :noweb yes
  <<procmail-rules(mailing-lists=mailing-lists)>>
#+end_src

Best -- Eric

Maurizio Vitale <mav@google.com> writes:

> Hi,
>   I have procmail rules defined in a org table which is then used as an
> argument for an elisp block which produces procmailrc results.
>
> Something like:
>
> #+tblname: mailing-lists
> | to      | emacs-users | emacs-users |
> #+TBLFM: 
>
>
> #+srcname: procmail-rules(mailing-lists=mailing-lists)
> #+begin_src emacs-lisp :exports results :results output :tangle no
> ... elisp code that evaluates to procmail rules  
> #+end_src
>
> #+results: procmail-rules :tangle /tmp/YYY
> :0:
> * ^TO_emacs-users@XXX.com
> $MAILDIR/emacs-users/
>
> I'd like to tangle the result section, not the code block. Is that
> possible?
>
> Thanks,
>
>         Maurizio
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: [babel] "tangle" results of source blocks?
  2010-11-08 20:15 ` Sébastien Vauban
@ 2010-11-08 21:15   ` Maurizio Vitale
  2010-11-08 21:36     ` Erik Iverson
  0 siblings, 1 reply; 6+ messages in thread
From: Maurizio Vitale @ 2010-11-08 21:15 UTC (permalink / raw)
  To: emacs-orgmode

>>>>> "Sébastien" == Sébastien Vauban <wxhgmqzgwmuf@spammotel.com> writes:

    Sébastien> Hello Maurizio,
    Sébastien> Maurizio Vitale wrote:
    >> Hi, I have procmail rules defined in a org table which is then
    >> used as an argument for an elisp block which produces procmailrc
    >> results.
    >> 
    >> Something like:
    >> 
    >> #+tblname: mailing-lists | to | emacs-users | emacs-users |
    >> #+TBLFM:
    >> 
    >> #+srcname: procmail-rules(mailing-lists=mailing-lists)
    >> #+begin_src emacs-lisp :exports results :results output :tangle
    >> no ... elisp code that evaluates to procmail rules #+end_src
    >> 
    >> #+results: procmail-rules :tangle /tmp/YYY :0: *
    >> ^TO_emacs-users@XXX.com
    >> $MAILDIR/emacs-users/
    >> 
    >> I'd like to tangle the result section, not the code block. Is
    >> that possible?

    Sébastien> See the "exports" header argument.

    Sébastien> http://orgmode.org/manual/exports.html#exports

That option controls what is exported, but I really need to tangle:
there're portions of the file, section headings and other documentation
that don't belong into the output file. So for instance given:

* Introduction
  This is a file that does blah
* Configuration
#+tblname: config
|a | nice table|

*Details
#+srcname: procmail-rules(config=config)
#+begin_src emacs-lisp :exports results :results output :tangle ~/.procmailrc
 ... elisp code that evaluates to procmail rules  
#+end_src

Of this entire file, noting should end up in ~/.procmailrc except for the
result of the evaluation of procmail-rules, which is what I hoped to
achieve with ':tangle ~/.procmailrc' and ':exports results' combined.

Thanks,

        Maurizio

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

* Re: [babel] "tangle" results of source blocks?
  2010-11-08 20:40 ` Eric Schulte
@ 2010-11-08 21:27   ` Maurizio Vitale
  0 siblings, 0 replies; 6+ messages in thread
From: Maurizio Vitale @ 2010-11-08 21:27 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1349 bytes --]

Sweet!
Thanks

On Mon, Nov 8, 2010 at 3:40 PM, Eric Schulte <schulte.eric@gmail.com> wrote:

> Hi Maurizio,
>
> You could try something like the following using the noweb expansion to
> run the code block and tangle its results.
>
> #+begin_src procmail :tangle yes :noweb yes
>  <<procmail-rules(mailing-lists=mailing-lists)>>
> #+end_src
>
> Best -- Eric
>
> Maurizio Vitale <mav@google.com> writes:
>
> > Hi,
> >   I have procmail rules defined in a org table which is then used as an
> > argument for an elisp block which produces procmailrc results.
> >
> > Something like:
> >
> > #+tblname: mailing-lists
> > | to      | emacs-users | emacs-users |
> > #+TBLFM:
> >
> >
> > #+srcname: procmail-rules(mailing-lists=mailing-lists)
> > #+begin_src emacs-lisp :exports results :results output :tangle no
> > ... elisp code that evaluates to procmail rules
> > #+end_src
> >
> > #+results: procmail-rules :tangle /tmp/YYY
> > :0:
> > * ^TO_emacs-users@XXX.com
> > $MAILDIR/emacs-users/
> >
> > I'd like to tangle the result section, not the code block. Is that
> > possible?
> >
> > Thanks,
> >
> >         Maurizio
> >
> >
> > _______________________________________________
> > Emacs-orgmode mailing list
> > Please use `Reply All' to send replies to the list.
> > Emacs-orgmode@gnu.org
> > http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>

[-- Attachment #1.2: Type: text/html, Size: 2029 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Re: [babel] "tangle" results of source blocks?
  2010-11-08 21:15   ` Maurizio Vitale
@ 2010-11-08 21:36     ` Erik Iverson
  0 siblings, 0 replies; 6+ messages in thread
From: Erik Iverson @ 2010-11-08 21:36 UTC (permalink / raw)
  To: Maurizio Vitale; +Cc: emacs-orgmode

Unfortunately I can't look this up at the moment, but
my guess is that the :results code option might help with
what you want?

Maurizio Vitale wrote:
>>>>>> "Sébastien" == Sébastien Vauban <wxhgmqzgwmuf@spammotel.com> writes:
> 
>     Sébastien> Hello Maurizio,
>     Sébastien> Maurizio Vitale wrote:
>     >> Hi, I have procmail rules defined in a org table which is then
>     >> used as an argument for an elisp block which produces procmailrc
>     >> results.
>     >> 
>     >> Something like:
>     >> 
>     >> #+tblname: mailing-lists | to | emacs-users | emacs-users |
>     >> #+TBLFM:
>     >> 
>     >> #+srcname: procmail-rules(mailing-lists=mailing-lists)
>     >> #+begin_src emacs-lisp :exports results :results output :tangle
>     >> no ... elisp code that evaluates to procmail rules #+end_src
>     >> 
>     >> #+results: procmail-rules :tangle /tmp/YYY :0: *
>     >> ^TO_emacs-users@XXX.com
>     >> $MAILDIR/emacs-users/
>     >> 
>     >> I'd like to tangle the result section, not the code block. Is
>     >> that possible?
> 
>     Sébastien> See the "exports" header argument.
> 
>     Sébastien> http://orgmode.org/manual/exports.html#exports
> 
> That option controls what is exported, but I really need to tangle:
> there're portions of the file, section headings and other documentation
> that don't belong into the output file. So for instance given:
> 
> * Introduction
>   This is a file that does blah
> * Configuration
> #+tblname: config
> |a | nice table|
> 
> *Details
> #+srcname: procmail-rules(config=config)
> #+begin_src emacs-lisp :exports results :results output :tangle ~/.procmailrc
>  ... elisp code that evaluates to procmail rules  
> #+end_src
> 
> Of this entire file, noting should end up in ~/.procmailrc except for the
> result of the evaluation of procmail-rules, which is what I hoped to
> achieve with ':tangle ~/.procmailrc' and ':exports results' combined.
> 
> Thanks,
> 
>         Maurizio
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

end of thread, other threads:[~2010-11-08 21:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-07 14:58 [babel] "tangle" results of source blocks? Maurizio Vitale
2010-11-08 20:15 ` Sébastien Vauban
2010-11-08 21:15   ` Maurizio Vitale
2010-11-08 21:36     ` Erik Iverson
2010-11-08 20:40 ` Eric Schulte
2010-11-08 21:27   ` Maurizio Vitale

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