From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stig Brautaset Subject: populating macros by parsing file name? Date: Wed, 25 May 2016 16:29:29 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5fxz-0007J6-OE for emacs-orgmode@gnu.org; Wed, 25 May 2016 17:03:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5fxw-0003Y2-Iz for emacs-orgmode@gnu.org; Wed, 25 May 2016 17:03:47 -0400 Received: from plane.gmane.org ([80.91.229.3]:32838) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5fxw-0003XL-C4 for emacs-orgmode@gnu.org; Wed, 25 May 2016 17:03:44 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1b5fxq-00010j-Ep for emacs-orgmode@gnu.org; Wed, 25 May 2016 23:03:38 +0200 Received: from 212.183.128.146 ([212.183.128.146]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 25 May 2016 23:03:38 +0200 Received: from stig by 212.183.128.146 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 25 May 2016 23:03:38 +0200 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: emacs-orgmode@gnu.org 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