From: Stig Brautaset <stig@brautaset.org>
To: emacs-orgmode@gnu.org
Subject: populating macros by parsing file name?
Date: Wed, 25 May 2016 16:29:29 +0100 [thread overview]
Message-ID: <m2h9dm9mxm.fsf@brautaset.org> (raw)
Hello!
Currently I have these three lines at the start of my invoices:
#+BEGIN_EXAMPLE
#+macro: invoice-no 11
#+date: 2016-06-01
#+title: Invoice #{{{invoice-no}}}
#+END_EXAMPLE
However, sometimes I forget to update the invoice number or date when copying
the old invoice. Since I name my invoices in the format =NN_YYYY-mm-dd.org=
I'm wondering if there's any way I can automatically populate the =invoice-no=
and date macros by parsing the file name? I found the {{{input-file}}}
macro, but I haven't been able to do anything useful with it.
Any help appreciated!
Stig
reply other threads:[~2016-05-25 21:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=m2h9dm9mxm.fsf@brautaset.org \
--to=stig@brautaset.org \
--cc=emacs-orgmode@gnu.org \
/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).