From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Rettke Subject: Re: Specifying the tangle filename based on the source filename? Date: Sun, 28 Jan 2018 14:47:11 -0600 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c1ce126e38b9c0563dc3bb8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eftr9-0006sW-Cv for emacs-orgmode@gnu.org; Sun, 28 Jan 2018 15:47:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eftr8-0007S5-AO for emacs-orgmode@gnu.org; Sun, 28 Jan 2018 15:47:15 -0500 Received: from mail-lf0-x235.google.com ([2a00:1450:4010:c07::235]:33438) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eftr8-0007RZ-36 for emacs-orgmode@gnu.org; Sun, 28 Jan 2018 15:47:14 -0500 Received: by mail-lf0-x235.google.com with SMTP id t139so7079513lff.0 for ; Sun, 28 Jan 2018 12:47:13 -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: Diego Zamboni Cc: Org-mode --94eb2c1ce126e38b9c0563dc3bb8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Jan 28, 2018 at 7:54 AM, Diego Zamboni wrote: > Hi, > > I=E2=80=99ve been converting many of my configuration files to org-mode t= o better > document them (examples: https://github.com/zzamboni/dot_emacs/blob/ > master/init.org, https://github.com/zzamboni/dot_elvish/blob/master/rc.or= g). > 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 avo= id > hardcoding the output file (=E2=80=9Cinit.el=E2=80=9D in this example) an= d 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. > > #+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 --94eb2c1ce126e38b9c0563dc3bb8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sun, Jan 28, 2018 at 7:54 AM, Diego Z= amboni <diego@zzamboni.org> wrote:
Hi,
I=E2=80=99ve been converting many of my configuration file= s to org-mode to better document them (examples:=C2=A0https:/= /github.com/zzamboni/dot_emacs/blob/master/init.org,=C2=A0https://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 :tan= gle init.el

So that all the code blocks in t= he file are, by default, tangled to the corresponding config file. I was wo= ndering 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.

--94eb2c1ce126e38b9c0563dc3bb8--