emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Dynamic tangle target?
@ 2016-09-21 19:13 Philip Hudson
  2016-09-22  1:06 ` Charles C. Berry
  0 siblings, 1 reply; 3+ messages in thread
From: Philip Hudson @ 2016-09-21 19:13 UTC (permalink / raw)
  To: emacs orgmode-mailinglist

AFAICT :tangle takes only "yes", "no", or a literal pathname. How
might I dynamically generate a pathname for :tangle? I suppose what I
want is some kind of escape syntax for eval'ing a Lisp form, like
maybe:

    :tangle %(my-dynamic-filename-generator)

Sorry if I'm missing something basic and obvious; I'm new to tangling.
I've been looking for a few days and found nothing so far, and even
though I'm sure the answer is out there, it seemed like at this point
my best bet is just to ask the ML. Might the answer be something to do
with either declaring a variable or using noweb syntax? I'm pretty
much in the dark here.

-- 
Phil Hudson                   http://hudson-it.ddns.net
@UWascalWabbit                 PGP/GnuPG ID: 0x887DCA63

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

* Re: Dynamic tangle target?
  2016-09-21 19:13 Dynamic tangle target? Philip Hudson
@ 2016-09-22  1:06 ` Charles C. Berry
  2016-09-22 19:36   ` Grant Rettke
  0 siblings, 1 reply; 3+ messages in thread
From: Charles C. Berry @ 2016-09-22  1:06 UTC (permalink / raw)
  To: Philip Hudson; +Cc: emacs orgmode-mailinglist

On Wed, 21 Sep 2016, Philip Hudson wrote:

> AFAICT :tangle takes only "yes", "no", or a literal pathname.

Stuff like

    :tangle (my-lisp-function arg1 arg2)

will work.

> How
> might I dynamically generate a pathname for :tangle? I suppose what I
> want is some kind of escape syntax for eval'ing a Lisp form, like
> maybe:
>
>    :tangle %(my-dynamic-filename-generator)

Try this:

#+BEGIN_SRC R :tangle (concat "my-" "file" ".R")
abs <- def
#+END_SRC

just as an example.

BTW, org-babel-view-src-block-info (C-c C-v C-i) will show you what header 
args evaluate as without the need to eval or tangle them.

HTH,

Chuck

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

* Re: Dynamic tangle target?
  2016-09-22  1:06 ` Charles C. Berry
@ 2016-09-22 19:36   ` Grant Rettke
  0 siblings, 0 replies; 3+ messages in thread
From: Grant Rettke @ 2016-09-22 19:36 UTC (permalink / raw)
  To: Charles C. Berry; +Cc: emacs orgmode-mailinglist, Philip Hudson

Most things that you can image are also listed here:

https://eschulte.github.io/org-scraps/

Awesome reading for Org-Mode Literate Programmers.
Sincerely,

Grant Rettke


On Wed, Sep 21, 2016 at 8:06 PM, Charles C. Berry <ccberry@ucsd.edu> wrote:
> On Wed, 21 Sep 2016, Philip Hudson wrote:
>
>> AFAICT :tangle takes only "yes", "no", or a literal pathname.
>
>
> Stuff like
>
>    :tangle (my-lisp-function arg1 arg2)
>
> will work.
>
>> How
>> might I dynamically generate a pathname for :tangle? I suppose what I
>> want is some kind of escape syntax for eval'ing a Lisp form, like
>> maybe:
>>
>>    :tangle %(my-dynamic-filename-generator)
>
>
> Try this:
>
> #+BEGIN_SRC R :tangle (concat "my-" "file" ".R")
> abs <- def
> #+END_SRC
>
> just as an example.
>
> BTW, org-babel-view-src-block-info (C-c C-v C-i) will show you what header
> args evaluate as without the need to eval or tangle them.
>
> HTH,
>
> Chuck
>

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

end of thread, other threads:[~2016-09-22 19:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-21 19:13 Dynamic tangle target? Philip Hudson
2016-09-22  1:06 ` Charles C. Berry
2016-09-22 19:36   ` Grant Rettke

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