emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] mark as done on a previous date?


From: Marco Wahl
Subject: Re: [O] mark as done on a previous date?
Date: Fri, 30 Dec 2016 13:14:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Hi!

> I'm trying to use org-habit to track my habits and sometimes I don't
> get around to mark stuff as done on the day I do them. I've found two
> different functions for marking stuff as done in the past, but I can't
> get either of them to work.
> [...]

I did not check why the other functions fail.

What about the following function?  I'm on Org 9.

#v+
(defun mw-org-todo-with-other-date (date &optional arg)
  "Like `org-todo' but ask for a specific DATE.
Optional argument ARG prefix arg."
  (interactive (list (org-read-date) current-prefix-arg))
  (let* ((org-use-effective-time t)
         (hour
          (truncate
           (- (/ (org-time-stamp-to-now date t)
                 60 60))))
          (org-extend-today-until (1+ hour)))
    (org-todo arg)))
#v-

This function has been inspired by Org's `org-todo-yesterday'.  The
latter even does its job when triggered from the agenda.


HTH
                       Marco




reply via email to

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