emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Turn function into interactive


From: Lawrence Bottorff
Subject: Turn function into interactive
Date: Sun, 29 Dec 2019 23:26:58 -0600

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:" )
      "<Pt" "Insert PROPERTIES time-uuid-level block" 'org-tempo-tags)


which gets distorted-munged, no doubt because it doesn't properly call and/or return org-outline-level. Any hints appreciated.


LB

reply via email to

[Prev in Thread] Current Thread [Next in Thread]