emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Turn function into interactive
@ 2019-12-30  5:26 Lawrence Bottorff
  2019-12-30 18:43 ` Berry, Charles
  0 siblings, 1 reply; 2+ messages in thread
From: Lawrence Bottorff @ 2019-12-30  5:26 UTC (permalink / raw)
  To: emacs-orgmode Mailinglist

[-- Attachment #1: Type: text/plain, Size: 946 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1774 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-30 18:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-30  5:26 Turn function into interactive Lawrence Bottorff
2019-12-30 18:43 ` Berry, Charles

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).