From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Bottorff Subject: Running in-line babel code at auto-insert template file open Date: Mon, 24 Feb 2020 21:51:08 -0600 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000097ce49059f5e6670" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:50461) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6RFl-0006zg-BM for emacs-orgmode@gnu.org; Mon, 24 Feb 2020 22:51:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6RFj-0007kr-0q for emacs-orgmode@gnu.org; Mon, 24 Feb 2020 22:51:25 -0500 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]:44877) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6RFi-0007k4-Nh for emacs-orgmode@gnu.org; Mon, 24 Feb 2020 22:51:22 -0500 Received: by mail-lf1-x12e.google.com with SMTP id 7so8519145lfz.11 for ; Mon, 24 Feb 2020 19:51:22 -0800 (PST) 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-mx.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode Mailinglist --00000000000097ce49059f5e6670 Content-Type: text/plain; charset="UTF-8" Let's say I have a standard org file I want to have created multiple times. I've created a template file and told Emacs autoinsert where it is. Here's the relevant in my init (use-package autoinsert :ensure t ... :config (define-auto-insert "poolchem.org?$" "poolchem.org")) So in this template file poolchem.org I have six table skeletons, but I also want various customized additions. For example, I would like the table names to reflect the current week starting with the coming Sunday's date #+tblname: pc1-*src_emacs-lisp[:results raw]{(org-read-date nil nil "++sun" nil (org-time-string-to-time "2020-02-24"))}* which would hopefully show up in the newly created buffer as #+tblname: pc1-2020-03-01 But then nothing of the sort happens, i.e., the in-line code just comes back verbatim when I create a new file, unevaluated. I guess I'm totally missing what is going on with in-line code. It seems other methods of template creation allow code to be embedded, then to be evaluated. (The variable auto-insert-alist has entire templates.) I've experimented with eval of org-sbe in # local variables: ... but that was for running code blocks upon file open, not individual embedded functions that would customize my newly created org file. Any ideas? LB --00000000000097ce49059f5e6670 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Let's say I have a standard org file I want to have cr= eated multiple times. I've created a template file and told Emacs autoi= nsert where it is. Here's the relevant in my init

(u= se-package autoinsert
=C2=A0 :ensure t
=C2=A0 ...
=C2=A0 :config=C2=A0 (define-auto-insert "poolch= em.org?$" "poolchem.org&q= uot;))

So in this template file poolchem.org I have six table skeletons, but I also want va= rious customized additions. For example, I would like the table names to re= flect the current week starting with the coming Sunday's date

#+tblname: pc1-src_emacs-lisp[:results raw]{(org-read-da= te nil nil "++sun" nil (org-time-string-to-time "2020-02-24&= quot;))}

which would hopefully show up in = the newly created buffer as

#+tblname: pc1-2020-03= -01

But then nothing of the sort happens, i.e.= , the in-line code just comes back verbatim when I create a new file, uneva= luated. I guess I'm totally missing what is going on with in-line code.= It seems other methods of template creation allow code to be embedded, the= n to be evaluated. (The variable auto-insert-alist has entire templates.) I= 've experimented with eval of org-sbe in # local variables: ... but tha= t was for running code blocks upon file open, not individual embedded funct= ions that would customize my newly created org file. Any ideas?
<= br>
LB

--00000000000097ce49059f5e6670--