emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ilya Chernyshov <ichernyshovvv@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Logging previous SCHEDULED property before changing TODO state of a habit
Date: Tue, 10 Oct 2023 02:23:09 +0700	[thread overview]
Message-ID: <8734yjlhwi.fsf@gmail.com> (raw)


Hi.

Is there anything I can do with my Org config so that every time I
change the TODO state of my habit (example below), Org logs inactive
timestamp from SCHEDULED property before TODO state change?

For example, I have this habit, which I have been forgetting to mark as
DONE/MISSED/WHATEVER for the past several days:


* TODO heading
SCHEDULED: <2023-10-05 Thu +1d>
:PROPERTIES:
:CREATED:  [2023-10-01 Sun 01:25]
:END:


Now, I want Org to log when I done the task and when I missed it, but
instead it inserts the timestamp of current time:


* TODO heading
SCHEDULED: <2023-10-08 Sun +1d>
:PROPERTIES:
:CREATED:  [2023-10-01 Sun 01:25]
:LAST_REPEAT: [2023-10-10 Tue 02:08]
:END:
:LOGBOOK:
- State "DONE"       from "TODO"       [2023-10-10 Tue 02:08]
- State "MISSED"     from "TODO"       [2023-10-10 Tue 02:08]
- State "DONE"       from "TODO"       [2023-10-10 Tue 02:08]
:END:


What I want to get instead is:


* TODO heading
SCHEDULED: <2023-10-08 Sun +1d>
:PROPERTIES:
:CREATED:  [2023-10-01 Sun 01:25]
:LAST_REPEAT: [2023-10-10 Tue 02:08]
:END:
:LOGBOOK:
- State "DONE"       from "TODO"       [2023-10-08 Sun]
- State "MISSED"     from "TODO"       [2023-10-07 Sat]
- State "DONE"       from "TODO"       [2023-10-06 Fri]
:END:


It would be awesome, if there was a placeholder in org-log-note-headings
(for example "%e") that is replaced with previous SCHEDULED
timestamp. Can we do that? Or is there a better option to achieve that?


             reply	other threads:[~2023-10-09 19:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-09 19:23 Ilya Chernyshov [this message]
2023-10-13 12:30 ` Logging previous SCHEDULED property before changing TODO state of a habit Ihor Radchenko

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  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=8734yjlhwi.fsf@gmail.com \
    --to=ichernyshovvv@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

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