From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Bottorff Subject: Turn function into interactive Date: Sun, 29 Dec 2019 23:26:58 -0600 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000004658db059ae5189c" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:41594) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ilnaF-000258-3o for emacs-orgmode@gnu.org; Mon, 30 Dec 2019 00:27:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ilnaD-0004nV-5a for emacs-orgmode@gnu.org; Mon, 30 Dec 2019 00:27:14 -0500 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]:38709) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ilnaC-0004jy-R9 for emacs-orgmode@gnu.org; Mon, 30 Dec 2019 00:27:13 -0500 Received: by mail-lf1-x136.google.com with SMTP id r14so24472590lfm.5 for ; Sun, 29 Dec 2019 21:27:10 -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.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode Mailinglist --0000000000004658db059ae5189c Content-Type: text/plain; charset="UTF-8" I've discovered org-outline-level which when in a code block under a given header delivers as expected: * This old level #+BEGIN_SRC emacs-lisp (org-current-level) #+END_SRC #+RESULTS: : 1 Now, how could I turn this into an interactive callable with M-x? My stab in the dark (defun my-insert-level () (interactive) (insert (org-outline-level))) doesn't seem to be working. Or is there already an interactive that will give me what level I'm at? My goal is to put this into a tempo template for a PROPERTIES key-value, and I assume this sort of construct (tempo-define-template "org-PROPERTIES_time-uuid-level" '(":PROPERTIES:" n ":HLEVEL: " (my-insert-level) n ":Time: " (my-insert-dateutc) n ":UUID: " (my-insert-uuid) n ":END:" ) "I've discovered org-outline-l= evel which when in a code block under a given header delivers as exp= ected:

* This old level
#+BE= GIN_SRC emacs-lisp
(org-current-level)
#+END_SRC

#+RESULTS:: 1

Now, how could I turn this into an= interactive callable with M-x? My stab in the dark

(defun my-insert-level ()
=C2=A0 (interactive= )
=C2=A0 (insert (org-outline-level)))


doesn= 't seem to be working. Or is there already an interactive that will giv= e me what level I'm at? My goal is to put this into a tempo template fo= r a PROPERTIES key-value, and I assume this sort of construct
<= div>
(tempo-define-template "org-PROPERTIES_time-uuid-level"<= br>'(":PROPERTIES:" n
":HLEVEL: " (my-insert= -level) n
":Time: " (my-insert-dateutc) n
":UU= ID: " (my-insert-uuid) n
":END:" )
=C2=A0 =C2= =A0 =C2=A0 "<Pt" "Insert PROPERTIES time-uuid-level block= " 'org-tempo-tags)


which gets distorted-munged, no doubt because it doesn&#= 39;t properly call and/or return=C2=A0org-o= utline-level. Any hints appreciated= .

<= br>
LB
--0000000000004658db059ae5189c--