emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Alan Lue <alan.lue@gmail.com>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Tangling to Multiple Files
Date: Sun, 28 Oct 2012 14:38:39 -0700	[thread overview]
Message-ID: <87pq42b7kw.fsf@rye.gateway.2wire.net> (raw)
In-Reply-To: <871ugimhba.fsf@gmail.com> (Eric Schulte's message of "Sun, 28 Oct 2012 15:12:57 -0600")

Thanks Eric, I didn't know that you could pass lisp code as header
arguments. It looks like it'll be best to conditionally tangle.

 :tangle (if (string-match "myhost" system-name) "yes" "no")

Eric Schulte <schulte.eric@gmail.com> writes:

> Alan Lue <alan.lue@gmail.com> writes:
>
>> Hi, how does one tangle a single code block to multiple files?
>>
>> I thought the following might work, but unfortunately it does not.
>>
>> Set the frame size.
>> #+HEADERS: :tangle user-host-a.el user-host-b.el
>> #+BEGIN_SRC emacs-lisp
>>   (setq initial-frame-alist '((width . 80) (height . 38)))
>> #+END_SRC
>>
>> To provide some background, I'm using =org-babel-load-file= in my
>> init.el file to load up my Emacs configuration from an Org file—call it
>> "user.org." I'd like to use just one user.org file across multiple
>> computers, however, meaning I'd like user.org to tangle into
>> user-host-a.el and user-host-b.el, for instance.
>>
>> The configurations are only slightly different, so I'd like to be able
>> to selectively indicate to Org-mode which code blocks to tangle
>> into.
>>
>>
>
> You could try something like the following to tangle out to a different
> file on each machine.
>
>   :tangle (format "%s.el" system-name)
>
> or
>
>   :tangle (format "%s.el" user-login-name)
>
> Hope this helps,

      reply	other threads:[~2012-10-28 21:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-28 20:12 Tangling to Multiple Files Alan Lue
2012-10-28 21:03 ` Thomas S. Dye
2012-10-28 21:12 ` Eric Schulte
2012-10-28 21:38   ` Alan Lue [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pq42b7kw.fsf@rye.gateway.2wire.net \
    --to=alan.lue@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=schulte.eric@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).