From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Landscheidt Subject: How to mark task as done at specified (past) time? Date: Thu, 28 Nov 2019 10:57:46 +0000 Message-ID: <875zj42rpx.fsf@passepartout.tim-landscheidt.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:56913) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iaHji-0001KP-EN for emacs-orgmode@gnu.org; Thu, 28 Nov 2019 06:13:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iaHUo-0004MP-2G for emacs-orgmode@gnu.org; Thu, 28 Nov 2019 05:58:03 -0500 Received: from 195-159-176-226.customer.powertech.no ([195.159.176.226]:46920 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iaHUn-00049A-QZ for emacs-orgmode@gnu.org; Thu, 28 Nov 2019 05:58:01 -0500 Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1iaHUj-000nnj-JL for emacs-orgmode@gnu.org; Thu, 28 Nov 2019 11:57:57 +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, with Emacs 26.2/org-mode 9.1.9, I have a repeating task that I close with a helper function: | (defun tl-entry-done () | (interactive) | (find-file "/path/to/file.org") | (goto-char (org-find-entry-with-id "ENTRY-ID")) | (org-todo 'done)) Every time I do this task, I get an acknowledging mail, so instead of manually closing this task (and forgetting to do that, or delaying it for some time) I want Gnus to mark the task as done /at the time when the mail was sent/, i. e. in: | - State "DONE" from "TODO" [2019-11-27 Mi 16:44] I want "2019-11-27 Mi 16:44" not to be the current time, but some other (past) time. How can I mark a task as done at a specified time? Looking at org-add-planning-info, there seems to be a mechanism to pass a timestamp, but it does not seem to be exposed at higher levels (?). Do I have to cl-flet org-current-time or something similar? Tim