From mboxrd@z Thu Jan 1 00:00:00 1970 From: Diego Zamboni Subject: Re: Specifying the tangle filename based on the source filename? Date: Sun, 28 Jan 2018 22:07:46 +0100 Message-ID: <37438715-6FE1-4014-9FF1-159A10567636@zzamboni.org> References: Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_03C6B9D0-30E7-4D22-8C66-A97AD9E01101" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34759) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1efuCN-0003WC-T0 for emacs-orgmode@gnu.org; Sun, 28 Jan 2018 16:09:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1efuCK-0002Ds-2t for emacs-orgmode@gnu.org; Sun, 28 Jan 2018 16:09:11 -0500 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]:39826) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1efuCJ-0002DJ-OZ for emacs-orgmode@gnu.org; Sun, 28 Jan 2018 16:09:08 -0500 Received: by mail-wm0-x231.google.com with SMTP id b21so30116659wme.4 for ; Sun, 28 Jan 2018 13:09:07 -0800 (PST) In-Reply-To: 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" To: Grant Rettke Cc: Diego Zamboni , Org-mode --Apple-Mail=_03C6B9D0-30E7-4D22-8C66-A97AD9E01101 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Ah, this is exactly what I was looking for. Thanks! =E2=80=94Diego > On 28 Jan 2018, at 21:47, Grant Rettke = wrote: >=20 > On Sun, Jan 28, 2018 at 7:54 AM, Diego Zamboni > wrote: > Hi, >=20 > I=E2=80=99ve been converting many of my configuration files to = org-mode to better document them (examples: = https://github.com/zzamboni/dot_emacs/blob/master/init.org = , = https://github.com/zzamboni/dot_elvish/blob/master/rc.org = ). Usually I = have a line like the following at the top of each org file: >=20 > #+PROPERTY: header-args:emacs-lisp :tangle init.el >=20 > So that all the code blocks in the file are, by default, tangled to = the corresponding config file. I was wondering if it might be possible = to avoid hardcoding the output file (=E2=80=9Cinit.el=E2=80=9D in this = example) and instead derive it from the source filename (=E2=80=9Cinit.org= =E2=80=9D in this case). I=E2=80=99ve looked a bit = through the manual and although I found the macro, I couldn=E2=80=99t = get it to work. >=20 > #+PROPERTY: header-args :tangle (concat (file-name-sans-extension = (buffer-file-name)) ".el") >=20 > #+NAME: org_gcr_2018-01-25_mara_5AA14ABD-5F82-4515-893A-B2370B6F4321 > #+BEGIN_SRC emacs-lisp > (message "Text") > #+END_SRC > =20 >=20 --Apple-Mail=_03C6B9D0-30E7-4D22-8C66-A97AD9E01101 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Ah, = this is exactly what I was looking for. Thanks!

=E2=80=94Diego

On 28 = Jan 2018, at 21:47, Grant Rettke <gcr@wisdomandwonder.com> wrote:

On Sun, Jan 28, 2018 at = 7:54 AM, Diego Zamboni <diego@zzamboni.org> wrote:
Hi,

I=E2=80=99ve been converting many of my = configuration files to org-mode to better document them = (examples: https://github.com/zzamboni/dot_emacs/blob/master/init.orghttps://github.com/zzamboni/dot_elvish/blob/master/rc.org). Usually I have a line like = the following at the top of each org file:

#+PROPERTY: = header-args:emacs-lisp :tangle init.el

So that all the code blocks in the file = are, by default, tangled to the corresponding config file. I was = wondering if it might be possible to avoid hardcoding the output file = (=E2=80=9Cinit.el=E2=80=9D in this example) and instead derive it from = the source filename (=E2=80=9Cinit.org=E2=80=9D in this case). I=E2=80=99= ve looked a bit through the manual and although I found the macro, I = couldn=E2=80=99t get it to work.

#+PROPERTY: = header-args :tangle (concat (file-name-sans-extension = (buffer-file-name)) ".el")

#+NAME: = org_gcr_2018-01-25_mara_5AA14ABD-5F82-4515-893A-B2370B6F4321
#+BEGIN_SRC emacs-lisp
(message = "Text")
#+END_SRC
 


= --Apple-Mail=_03C6B9D0-30E7-4D22-8C66-A97AD9E01101--