From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marco Wahl Subject: Re: mark as done on a previous date? Date: Fri, 30 Dec 2016 13:14:52 +0100 Message-ID: <84eg0p7gw3.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43718) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMw5V-0002lL-U8 for emacs-orgmode@gnu.org; Fri, 30 Dec 2016 07:15:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMw5S-0002RO-Pl for emacs-orgmode@gnu.org; Fri, 30 Dec 2016 07:15:09 -0500 Received: from [195.159.176.226] (port=49622 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cMw5S-0002PB-Hz for emacs-orgmode@gnu.org; Fri, 30 Dec 2016 07:15:06 -0500 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cMw5K-0006fo-1L for emacs-orgmode@gnu.org; Fri, 30 Dec 2016 13:14:58 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org 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