From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id qJc2NJtlmGROCQAASxT56A (envelope-from ) for ; Sun, 25 Jun 2023 18:04:43 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id IFREM5tlmGTqxAAAG6o9tA (envelope-from ) for ; Sun, 25 Jun 2023 18:04:43 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5C278364D3 for ; Sun, 25 Jun 2023 18:04:43 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qDSDV-0000xb-4q; Sun, 25 Jun 2023 12:03:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDSDT-0000xC-Aq for emacs-orgmode@gnu.org; Sun, 25 Jun 2023 12:03:55 -0400 Received: from mail-oi1-f179.google.com ([209.85.167.179]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qDSDQ-00065w-MV for emacs-orgmode@gnu.org; Sun, 25 Jun 2023 12:03:55 -0400 Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-3a1a12e95b1so1959290b6e.0 for ; Sun, 25 Jun 2023 09:03:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687709031; x=1690301031; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=n2MyjE/wOxqlIu+MaV2Ro/dNqsiafqPTK7bYfFo+VcI=; b=YhSyGTaeisYpWZltizeCCCFMfdlrP5/Qy+U4GjGiSK3lCKokACK0G1kVfEUySlJkUb 0PiC50DLhIK20wDxoct6bUSMUPXIErzpvc+5vWIRuK3r6WcIUCk1oIRtzJCIx7h6wOpV QctSJ2rs8YdWkSxCChOEdWkchxYZ4iiLFD9nxvtxQP9l2Es63wXnmdtGBN4LyOinO5rL af0q0NG7TNYYDWLwDVf/+O1B9CTHzL6YsPkgUdmGQ/GGlwUO+kVQwURJAWDsnZBa9c43 /BJkKhM9s7U+Js+vclRd2Jj2avSZv/xMTo4zgDGEsT8E85U+12tl5Qa8nNAzCcCvT+7Z WL1w== X-Gm-Message-State: AC+VfDwsxL6/uWtX5M8t0vVTGVZzHnPJAsRdQQkiO6L8yFoSaRyzznBd woeOEUh7KkCdDxmVh1pg/g++NaMSRvI8DRbc72pFoX4CRGSq0A== X-Google-Smtp-Source: ACHHUZ552ELzfMp+rWqkfgno9HBgqD8fc7TKXb3oU0rF6SuQg+q966a6kefYj1CYgt1UkLEIW9pzojqgpmWYqESIUmk= X-Received: by 2002:aca:de54:0:b0:3a1:bced:9e83 with SMTP id v81-20020acade54000000b003a1bced9e83mr1967923oig.5.1687709030662; Sun, 25 Jun 2023 09:03:50 -0700 (PDT) MIME-Version: 1.0 References: <20200707112656.wgsv7wfcnfeak6ik@gmail.com> <87k0ze621e.fsf@kyleam.com> In-Reply-To: <87k0ze621e.fsf@kyleam.com> From: Adam Spiers Date: Sun, 25 Jun 2023 17:03:39 +0100 Message-ID: Subject: Re: time-warping - retroactively marking DONE? To: Kyle Meyer Cc: org-mode mailing list Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=209.85.167.179; envelope-from=adam.spiers@gmail.com; helo=mail-oi1-f179.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1687709083; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=n2MyjE/wOxqlIu+MaV2Ro/dNqsiafqPTK7bYfFo+VcI=; b=Be1SuDoOcSJiU6OC+wLTZKQQbSy2YvDpxr6SvvdsOVIxKme1ZJ4lBTJJBfkpVbqlwoXkxw dUxayMF64u4sViR2BKdZHO2qVfmRfNWqMXJp9hTPbkqI0A/155lyEV+76DNUNxvZB465YI H8pCFcUc3gVsqglJFYb4ox0SLHXN2ebZzZhO7wP1SQ8yPW4KgpJ8DWO7LvH0pWFQQCVyHf 96B/73DBoJ11ZqFzx0I3yLhQlIymySbendhiSl6aoB/Wm/igweAUGzCxgGmtv/beEqrVbs 8M3yJOnpngM5Gx5cpMxg1+d+P3v7VJnzBWMvwTg2hw9ljdimMjrSYVprEc/pkw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=adamspiers.org (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1687709083; a=rsa-sha256; cv=none; b=rBln0cQ2Kro5ZQFbx/cVqrV6NVNcY/xDD7U0YrpXqC8UK5H4UwsyMgq8einYT170bOzwCv PxyzZ7H7gElMoYj9eKWjmJyDE3mFNisHLA0pJWNerqPKjGm4MFJcmA4aJk/TRJct+YXW/+ B++r9wO6iAXkELk/WTATvJeDPvzyLGycqbsuy5GhumB+Lg8sBVWZFysDagGfY+C+bYQmP3 nZsxsjTfFRRgxiZH0O7Lm4VOrFpNCfT5r1i515nrr+bHh2LSLUDzi79VkYpBfgDGw5Jc88 1AbHKLKz9e/k6qS26ygtjczY6Mi4zzXRR1UMmDXYdLctrhsuxr1u/D4AjsRL6Q== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -0.45 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=adamspiers.org (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 5C278364D3 X-Spam-Score: -0.45 X-TUID: j8XB5i4w0Nej Three years later, I finally tried this: On Wed, 8 Jul 2020 at 05:53, Kyle Meyer wrote: > Adam Spiers writes: > > I'm looking for a way to retroactively mark a task as having been done > > at a previous time/date. I know that I can just change the keyword to > > DONE and then edit the timestamp, but this is tedious when it's a > > repeating event, e.g.: > [...] > > I'm not aware of any built-in support for this. > > > If this is not currently possible, would it make sense to write a > > wrapper around `org-todo', e.g. `org-todo-timewarp' or > > `org-retroactive-todo', which interactively prompts for a timestamp > > before invoking `org-todo'? > > I think this is the easiest approach, though I'm not sure such a wrapper > needs to live in Org proper. Here's a snippet from a recent thread [*] > that should get you most of the way there: > > (defun my-org-todo-time-machine () > (interactive) > (cl-letf (((symbol-function 'current-time) > (lambda () > (apply #'encode-time (org-parse-time-string > "2019-11-27 Mi 16:44"))))) > (call-interactively #'org-todo))) > > > [*] https://orgmode.org/list/875zj42rpx.fsf@passepartout.tim-landscheidt.de/T/#u I made it read a time interactively: (defun as-org-todo-time-machine (arg) (interactive "P") (let ((fake-time (apply #'encode-time (org-parse-time-string (org-read-date) )))) (cl-letf (((symbol-function 'current-time) (lambda () fake-time))) (call-interactively #'org-todo)))) It almost works perfectly, although monkey-patching current-time doesn't affect the code in org-auto-repeat-maybe which sets LAST_REPEAT, since that uses the built-in format-time-string: (org-entry-put nil "LAST_REPEAT" (format-time-string (org-time-stamp-format t t)))) I found that adding (current-time) as the optional time parameter fixed it: (org-entry-put nil "LAST_REPEAT" (format-time-string (org-time-stamp-format t t) (current-time)))) since that allows the monkey-patching to apply there too. Is it worth submitting a patch for this?