From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Bottorff Subject: Insert PROPERTIES drawer after heading creation Date: Tue, 10 Mar 2020 23:39:04 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000a0661705a08cd1a6" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:48556) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBt9M-0001ut-5j for emacs-orgmode@gnu.org; Wed, 11 Mar 2020 00:39:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jBt9L-0006ap-7t for emacs-orgmode@gnu.org; Wed, 11 Mar 2020 00:39:20 -0400 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]:42875) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jBt9K-0006ZG-UE for emacs-orgmode@gnu.org; Wed, 11 Mar 2020 00:39:19 -0400 Received: by mail-lj1-x231.google.com with SMTP id q19so739453ljp.9 for ; Tue, 10 Mar 2020 21:39:18 -0700 (PDT) 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 --000000000000a0661705a08cd1a6 Content-Type: text/plain; charset="UTF-8" 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 --000000000000a0661705a08cd1a6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I want to insert upon creating a heading a PROPERTIES draw= er. So far I have this

(defadvice org-insert-heading (after add-id-s= tuff activate)
=C2=A0 (template-myid))

(defun template-myid ()=C2=A0 (insert "\n:PROPERTIES:\n:TIME: "
=C2=A0 =C2=A0 =C2=A0= (substring (format "%s" (format-time-string "%Y-%m-%dT%H:%M= :%S")))
=C2=A0 =C2=A0 =C2=A0 "\n:VERTEX: "
=C2=A0 =C2= =A0 =C2=A0 (substring (format "%s" (shell-command "uuidgen&q= uot; t)))
=C2=A0 =C2=A0 =C2=A0 "\n:EDGES: =C2=A0\n:END:"))
This is working -- sort of. My problem is the uuid is getting thrown a= round. The output looks like this

* Heading
:PROPERTIES:
:TIME= : 2020-03-10T23:34:17
:VERTEX: 12836
:EDGES: =C2=A0
:END:32bf9499-= f9e2-49d9-b8e7-9edb40272411

Not sure how to make this behave.=

LB
--000000000000a0661705a08cd1a6--