|
From: | Lawrence Bottorff |
Subject: | Re: Insert PROPERTIES drawer after heading creation |
Date: | Wed, 11 Mar 2020 08:14:20 -0500 |
Hi LB,How about using the =org-id-uuid= function instead of shelling out to uuidgen? In my quick test the following seems to behave properly:(defun template-myid ()(insert "\n:PROPERTIES:\n:TIME: "(format-time-string "%Y-%m-%dT%H:%M:%S")"\n:VERTEX: "(org-id-uuid)"\n:EDGES: \n:END:"))Note that I also removed the wrapping (substring (format ...)), which didn't seem to be necessary.--DiegoOn Wed, Mar 11, 2020 at 5:39 AM Lawrence Bottorff <address@hidden> wrote:I want to insert upon creating a heading a PROPERTIES drawer. So far I have this
(defadvice org-insert-heading (after add-id-stuff activate)
(template-myid))
(defun template-myid ()
(insert "\n:PROPERTIES:\n:TIME: "
(substring (format "%s" (format-time-string "%Y-%m-%dT%H:%M:%S")))
"\n:VERTEX: "
(substring (format "%s" (shell-command "uuidgen" t)))
"\n:EDGES: \n:END:"))
This is working -- sort of. My problem is the uuid is getting thrown around. The output looks like this
* Heading
:PROPERTIES:
:TIME: 2020-03-10T23:34:17
:VERTEX: 12836
:EDGES:
:END:32bf9499-f9e2-49d9-b8e7-9edb40272411
Not sure how to make this behave.LB
[Prev in Thread] | Current Thread | [Next in Thread] |