[Top][All Lists]

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

Re: How can I use org-add-note with emacsclient?

From: Ihor Radchenko
Subject: Re: How can I use org-add-note with emacsclient?
Date: Mon, 25 Dec 2023 14:35:32 +0000

equal.moon0346@fastmail.com writes:

> I'm trying to figure out how to start a note (C-c C-z) on the currently 
> clocked task from emacsclient. Here's what I have so far:
> ...
> emacsclient -s test -nw --eval '(progn (org-clock-goto) (org-add-note))'
> This seems to have no effect. Oddly, if I paste this into M-:, it works fine. 
> I've tried a number of things with e.g. plain capture templates that run the 
> above code :after-finalize, using call-interactively, etc. After a cursory 
> reading through the info manual on interactivity I find I'm still a bit lost. 
> Can anyone explain what I'm doing wrong and hopefully point me to the right 
> manual page to read on this?

`org-add-note' is implemented a bit awkwardly using post-command-hook,
which makes it work only interactively.
The hook does not trigger when you use --eval. That's why you are not
seeing the note buffer after running the above shell command.

What you can do is manually call the function used to raise the note

emacsclient -nw --eval '(progn (org-clock-goto) (org-add-note) 

Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

reply via email to

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