From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Lue Subject: Re: Tangling to Multiple Files Date: Sun, 28 Oct 2012 14:38:39 -0700 Message-ID: <87pq42b7kw.fsf@rye.gateway.2wire.net> References: <87txtebbjt.fsf@rye.gateway.2wire.net> <871ugimhba.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:57190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TSaZ9-0003xe-Tt for emacs-orgmode@gnu.org; Sun, 28 Oct 2012 17:38:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TSaZ8-0005Sa-Py for emacs-orgmode@gnu.org; Sun, 28 Oct 2012 17:38:43 -0400 Received: from mail-oa0-f41.google.com ([209.85.219.41]:43518) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TSaZ8-0005SW-K2 for emacs-orgmode@gnu.org; Sun, 28 Oct 2012 17:38:42 -0400 Received: by mail-oa0-f41.google.com with SMTP id k14so4716492oag.0 for ; Sun, 28 Oct 2012 14:38:41 -0700 (PDT) In-Reply-To: <871ugimhba.fsf@gmail.com> (Eric Schulte's message of "Sun, 28 Oct 2012 15:12:57 -0600") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: emacs-orgmode@gnu.org 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 writes: > Alan Lue 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 =3Dorg-babel-load-file=3D in my >> init.el file to load up my Emacs configuration from an Org file=E2=80=94= 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,