emacs-orgmode
[Top][All Lists]
Advanced

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

Re: Manually/programmatically adding a state transition message


From: Ihor Radchenko
Subject: Re: Manually/programmatically adding a state transition message
Date: Sun, 03 Oct 2021 22:54:20 +0800

Trevoke <trevoke@gmail.com> writes:

> If I understand correctly, this will prevent the addition of a note; I have
> already found a way to do this. Please let me know if I am mistaken.
> What I am looking for is a way to programmatically, without user input,
> change the state and add an automatic note.

No.  Setting this variable programatically is an equivalent of "0"
prefix arg.  Just try it yourself (replacing CANCELLED with whatever
todo keyword that normally triggers interactive note for you):

(let ((org-inhibit-logging 'note)) (org-todo "CANCELLED"))

> If I understand correctly, org-mode implements the addition of the note
> through the function `org-add-log-note` and `org-store-log-note`, and I was
> really hoping I wouldn't have to sift through these two functions to figure
> out and possibly reimplement all the logic of how it finds the place where
> to add the note so I can insert the string there myself.

Yes. Unfortunately, this note system is not very configurable. Though
your specific case is (somewhat awkwardly) covered. In org-add-log-note,
there is the following line:

(if (memq org-log-note-how '(time state))

The org-log-note-how is set in org-add-log-setup according to its args.

org-todo calls org-add-log-setup depending on the value of
org-inhibit-logging.

Thus, my suggestion.

And yes, it is cumbersome. We should re-implement the note system some
day in future.

Best,
Ihor



reply via email to

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