From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id qDvEESiozGT6ngAASxT56A (envelope-from ) for ; Fri, 04 Aug 2023 09:26:32 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id SPi8ESiozGQm7gAA9RJhRA (envelope-from ) for ; Fri, 04 Aug 2023 09:26:32 +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 3C47250868 for ; Fri, 4 Aug 2023 09:26:31 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=bcc32.com header.s=fm3 header.b=Xf6icXKZ; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm3 header.b=LjREbvmj; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=bcc32.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1691133992; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=yn/2SyCWX04MXaQO3yoZJFQnFmTXsu5eOKumiIq6pjY=; b=TM/jBgP5hKJEUlrilLyYU/GtKvTUF3fbGujH3lSk0Z91bz+KBeKccv4DaYeNGcbCpjc7YE Aba0OFryY2R1kztEEYubP7QKrwZRz4fi3VC7UDljZHtubxrc9t/zfVdS7p8R3mPZTdX31C v8QHuXIhedF+GZ7IQcS+6zVAC6Vat0oTAlJTkjP49lnInPDIkSlA3hQ395uMz46rGOf0wI snIKpyWnYTBRM7NmH+Zbamd4mQ5zRynRMpzFrAm+4aH0auRcJXMXk36qO+TMFWw8cYjjxL ZAMIywoqb85V3Do760bbCtEmn94az92c/C5+SaYhU0XnmoRT745ccnQCAWAo5w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1691133992; a=rsa-sha256; cv=none; b=lkQGVWGaRiBhveUNirpZZzHQSPhlUNy4mJ0N4O+08MVGRefG+lMN3hQFD/q5DMFIBOzS0E SfidTo63gXOsMMk1oM5FVzgCLNBLxEFoCPtjFAuzjNNbe0RlIJ9/uAh1VIODN1s+Z7/br2 4U7qU4dOqzRoLUEKXf/ucO6bDKXpf+4LskHTv5kzGf/jCuegPyF5YjN5zxS1rrHdiHR+PB 3r1t+01CruxZ38ZIrYlWAAz9iMNIBxM7PHY/KuIrF6mLLOK24JKENC4eUSGztFib64arDd u4hkMw/lW4V8M4YGDETTznsikbqJocwnrEu8CpIXbtYpKSk55zFhOU8FmK8rAw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=bcc32.com header.s=fm3 header.b=Xf6icXKZ; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm3 header.b=LjREbvmj; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=bcc32.com (policy=none) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRpCb-0005MV-2L; Fri, 04 Aug 2023 03:26:25 -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 1qRfpR-0004yn-Jh for emacs-orgmode@gnu.org; Thu, 03 Aug 2023 17:25:54 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRfpP-0002HJ-PZ for emacs-orgmode@gnu.org; Thu, 03 Aug 2023 17:25:53 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 50AC43200A0C for ; Thu, 3 Aug 2023 17:25:47 -0400 (EDT) Received: from imap46 ([10.202.2.96]) by compute6.internal (MEProxy); Thu, 03 Aug 2023 17:25:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bcc32.com; h=cc :content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm3; t=1691097946; x=1691184346; bh=yn/2SyCWX04MXaQO3yoZJFQnF mTXsu5eOKumiIq6pjY=; b=Xf6icXKZ4iRB/Ah9kX0NOILaXt6F/wvPSzUJc1gJm 2KfJJ3MDzAlGpArR68ZFrV8vdH8ARmdUyPv7LPP+4LeKONmT5ziHMlPEmM1CrBTi VH2+mEnagmwii4JOoK0+xmTNGb8bUjt0Rez2r143yv0matjLzudD3fXd5xgpXvt4 +PhUlCF+dOlngiporO97NWXXhi3aAuq72M0RofT60R19Z5rgZOEhtGNGKZhIZ50S 8o41vsLY51a/JWVywb1FvIU292+QhfZjqCKYUbZIaLXBcnNOb0Ov9Y74EYlmh+Jz 1rw2gnM0a0JbSokCJQROFlfCn69c5NeUeLkmvF1SW4UDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1691097946; x=1691184346; bh=yn/2SyCWX04MXaQO3yoZJFQnFmTXsu5eOKu miIq6pjY=; b=LjREbvmjTocJE0QkmK4ogmnR8UKDeMNARoIfqVGuM7Fkkb2Ecpq 84CnJ0P5+iLRtBl3gnuyo/NTkMrXxpwirIvYEkh7krJ9OkRSKTXwVzRovAQwkm9s 6zV+GAYAwvQBeMXcHwOKas5l7AqD+AZV1E5styhIRspTmBY9RlJACMob/fUEiVph r0IBZ5+J9zRzBH8Es3twEysdqnCdyIRX+oxIe7YE99dQwnqeP+tk8lsRborMFupf CjBtWAzm/ih2rNL6z9irJB0Tvmf/3ltQLAGrnG3rQQBQTQK/+fAvlkGWC1FGRIWz HilAhcGT0AoPlSRU2LIJfI7AOLfYOq61TUA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrkedvgdduheekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfffhffvufgtsehttdertd erredtnecuhfhrohhmpedftegrrhhonhcukggvnhhgfdcuoeiisegstggtfedvrdgtohhm qeenucggtffrrghtthgvrhhnpedttddugfeiueeujeffffekleekvdeiudelveffkeeftd ekudfhhffgheekfeefffenucffohhmrghinhepvghmrggtshdrrghpphenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeiisegstggtfedvrdgtoh hm X-ME-Proxy: Feedback-ID: iba994645:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 886632A2008B; Thu, 3 Aug 2023 17:25:46 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-624-g7714e4406d-fm-20230801.001-g7714e440 Mime-Version: 1.0 Message-Id: <29065f4d-de2c-4790-8b68-c4f47bf0dcfe@app.fastmail.com> Date: Thu, 03 Aug 2023 17:25:26 -0400 From: "Aaron Zeng" To: emacs-orgmode@gnu.org Subject: [BUG] Bad interaction between org-add-log-setup and org-with-remote-undo [9.6.6 (release_9.6.6 @ /Applications/Emacs.app/Contents/Resources/lisp/org/)] Content-Type: text/plain Received-SPF: pass client-ip=64.147.123.19; envelope-from=z@bcc32.com; helo=wout3-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 04 Aug 2023 03:26:21 -0400 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 3C47250868 X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -2.22 X-Spam-Score: -2.22 X-TUID: Wqg3VWB56Rm8 Hi folks, It seems there is a bad interaction between org-add-log-setup and org-with-remote-undo, such that org-agenda-undo does not function correctly. For example, 1. Enable logging on reschedule, by setting `org-log-reschedule' to `time'. 2. Reschedule an already-scheduled TODO item through an agenda buffer, by pressing C-c C-s (org-schedule). 3. Press C-/ (org-agenda-undo) while still in the agenda buffer. This has the unfortunate consequence of undoing all of the changes in the agenda buffer but only a subset of the changes in the source buffer where the task was defined (namely, the "rescheduled" log entry is removed but the timestamp is not restored to the original time). I believe this is because org-with-remote-undo creates an undo boundary after executing the body of the macro, but org-add-log-setup makes changes to the buffer in post-command-hook, after the undo-boundary is created. This means that /two/ undoable changes in the source buffer now logically correspond to the same change in the agenda buffer, which org-agenda-undo does not handle correctly. Some commands do not have this issue, such as org-agenda-todo, which calls org-add-log-note instead of org-add-log-setup and therefore does not make use of post-command-hook. This seems to be intentional: ;; Make sure that log is recorded in current undo. (when (and org-log-setup (not (eq org-log-note-how 'note))) (org-add-log-note)) I wonder if org-add-log-setup should be removed and refactored away, or if org-with-remote-undo should not be creating an undo boundary (which sounds redundant with the automatic ones created by the command loop?). Emacs : GNU Emacs 29.1 (build 1, aarch64-apple-darwin21.6.0, NS appkit-2113.60 Version 12.6.6 (Build 21G646)) of 2023-07-30 Package: Org mode version 9.6.6 (release_9.6.6 @ /Applications/Emacs.app/Contents/Resources/lisp/org/ )