emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Trevoke <trevoke@gmail.com>
Cc: Org-Mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: Manually/programmatically adding a state transition message
Date: Sun, 03 Oct 2021 22:54:20 +0800	[thread overview]
Message-ID: <87lf3acg6b.fsf@localhost> (raw)
In-Reply-To: <CAHGcNQ_R23Ob+bN6YS0jxQTUSG0SbgAKzGqEhjUeNx2hLp6pCw@mail.gmail.com>

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

Thus, my suggestion.

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


      reply	other threads:[~2021-10-03 14:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-18 18:28 Manually/programmatically adding a state transition message Trevoke
2021-10-02  9:19 ` Ihor Radchenko
2021-10-03 14:30   ` Trevoke
2021-10-03 14:54     ` Ihor Radchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lf3acg6b.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=trevoke@gmail.com \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).