emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Question about using `org-add-note' programmatically
@ 2021-11-30  0:57 Tor Kringeland
  0 siblings, 0 replies; only message in thread
From: Tor Kringeland @ 2021-11-30  0:57 UTC (permalink / raw)
  To: emacs-orgmode

I'm trying to write a function that adds a note to the current
`org-mode' heading.  Naively I write it as

  (defun my/add-note ()
    (insert "some text")

but this does not work.  Calling the function (on a recent build of
Emacs 29) inserts the string "some text" into the current buffer and
then opens up the note from `org-add-note'.  (IIRC this used to work
earlier this year (in September) but I don't know why (nor is it
relevant).)  Currently my solution has been to define the function as a
keyboard macro (using `fset'), which works perfectly, but I do hanker
for a cleaner solution.

Maybe what I want isn't the intended behavior of these `org' functions,
but does someone know how I can achieve what I want in a cleaner way,
than using keyboard macros?

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-30 12:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-30  0:57 Question about using `org-add-note' programmatically Tor Kringeland

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


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).