emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Specifying the tangle filename based on the source filename?


From: Grant Rettke
Subject: Re: [O] Specifying the tangle filename based on the source filename?
Date: Sun, 28 Jan 2018 14:47:11 -0600

On Sun, Jan 28, 2018 at 7:54 AM, Diego Zamboni <address@hidden> wrote:
Hi,

I’ve 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 (“init.el” in this example) and instead derive it from the source filename (“init.org” in this case). I’ve looked a bit through the manual and although I found the macro, I couldn’t 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
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]