emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Diego Zamboni <diego@zzamboni.org>
To: Grant Rettke <gcr@wisdomandwonder.com>
Cc: Diego Zamboni <diego@zzamboni.org>, Org-mode <emacs-orgmode@gnu.org>
Subject: Re: Specifying the tangle filename based on the source filename?
Date: Sun, 28 Jan 2018 22:07:46 +0100	[thread overview]
Message-ID: <37438715-6FE1-4014-9FF1-159A10567636@zzamboni.org> (raw)
In-Reply-To: <CAAjq1mdQwyJAihA5QpBVofQi92UXZKN-fPo3XXd=ZqumDadcgA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1393 bytes --]

Ah, this is exactly what I was looking for. Thanks!

—Diego

> 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 <mailto:diego@zzamboni.org>> 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.org <https://github.com/zzamboni/dot_emacs/blob/master/init.org>, https://github.com/zzamboni/dot_elvish/blob/master/rc.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:
> 
> #+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 <http://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
>  
> 


[-- Attachment #2: Type: text/html, Size: 2760 bytes --]

      reply	other threads:[~2018-01-28 21:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-28 13:54 Specifying the tangle filename based on the source filename? Diego Zamboni
2018-01-28 18:13 ` Jack Henahan
2018-01-28 20:15   ` Diego Zamboni
2018-01-28 20:47 ` Grant Rettke
2018-01-28 21:07   ` Diego Zamboni [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=37438715-6FE1-4014-9FF1-159A10567636@zzamboni.org \
    --to=diego@zzamboni.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=gcr@wisdomandwonder.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).