From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 1fGGDDTe8mAHXgAAgWs5BA (envelope-from ) for ; Sat, 17 Jul 2021 15:42:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id GKWfBzTe8mBIEgAAbx9fmQ (envelope-from ) for ; Sat, 17 Jul 2021 13:42:12 +0000 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 AC9C01B222 for ; Sat, 17 Jul 2021 15:42:11 +0200 (CEST) Received: from localhost ([::1]:54266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4ka2-00072D-L2 for larch@yhetil.org; Sat, 17 Jul 2021 09:42:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58042) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4kZQ-000725-V5 for emacs-orgmode@gnu.org; Sat, 17 Jul 2021 09:41:32 -0400 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]:43606) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4kZP-0001mI-8t for emacs-orgmode@gnu.org; Sat, 17 Jul 2021 09:41:32 -0400 Received: by mail-lf1-x134.google.com with SMTP id f30so14267349lfv.10 for ; Sat, 17 Jul 2021 06:41:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=Gq7PPKJ+EgE3jwAlynW/VJ2gYYyVf60pG8GkTRfW1OY=; b=EgVqTsR8779j7/hDPeM/ltJ3+LlAoXAqBMgusKNf8bmI/t05jD5PdPrkzlYZH0HSp8 dwuQMzKLvINqzTdsO4spo5tGv2nyUlD0t4AE8w9IIrzA++8k8rerHRF/V1RHx69j/I0u OHRnczrOknle5YYTq3XV1Ij9zZfZ56FCMat7MW9tTLahJxEEqLTJJaOjWo6FME0Itcn+ +OYCdY2O8oVnDRPkMaVpWuRW1nUClQynqZIlE0o8PeP7uJ97psolz5+otMILuTRz0xs1 Av8LbnCXvuoWljrbwcbqdD/VPlLtB7NxH8yGC78R5BWbBmEDKyF6diqjTZuGvcXiS5EX PNQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=Gq7PPKJ+EgE3jwAlynW/VJ2gYYyVf60pG8GkTRfW1OY=; b=UzKXxt63RR/1RxVxQBq8B2CC3eHgNwdgeyzS4YY7wqWNUp2WGeMQSeitEX9SZU+6n4 7IdCsWKXezk5p6PQGmvDKZv0W9w1Mc2TEUAwjos5lT2Qg/zRlqBJ6LCRxvY5uVxUqCN+ RoP/T9iCQDqfP6s6Y59JVhQz+SKQrQAbUqZy79Z6aH5SSzC28eWJ0smURmjHazQ2xnbe G8VH0gNznOJ92vK5N4CctJ2IEeVB+3mCCVygqGjJxk6na3pZxHt1o/5LPjqx7r30j6kE FYqDR/u83ZRPQ0B6V5nIz7Kcwb41KeYgGk/n+guY8hpbqwl8eYZOCL2GKc+cAFqV+47/ a5qg== X-Gm-Message-State: AOAM532XzSkz/iRNxpBXia7WBKj5u47/D2SACRpNLxYoQTBOuyxncq0y 9UhGf4aNKGnRNAr7YSDi0x0= X-Google-Smtp-Source: ABdhPJxyLHhgd1/JRiLqWUzqw6PrDTrjmntz/kl2+hRAaws+BiF4FFTkeW0fKvgsqK+2waHgQexLkQ== X-Received: by 2002:a05:6512:3e11:: with SMTP id i17mr11930402lfv.233.1626529289377; Sat, 17 Jul 2021 06:41:29 -0700 (PDT) Received: from localhost ([158.255.2.9]) by smtp.gmail.com with ESMTPSA id u14sm873359lfn.47.2021.07.17.06.41.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jul 2021 06:41:28 -0700 (PDT) From: Ihor Radchenko To: Bhavin Gandhi Subject: Re: [PATCH] Re: Bug: Duplicate logbook entry for repeated tasks [9.4.6 (9.4.6-gab9f2a @ /home/gustavo/.emacs.d/elpa/org-9.4.6/)] In-Reply-To: References: <877diwbm6a.fsf@gmail.com> <87a6muwa93.fsf@localhost> <874kd1wsc6.fsf@localhost> <871r85wgqd.fsf@localhost> <87wnpxv1d8.fsf@localhost> Date: Sat, 17 Jul 2021 21:41:28 +0800 Message-ID: <87lf656os7.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=yantar92@gmail.com; helo=mail-lf1-x134.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org, Gustavo Barros Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1626529331; 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:dkim-signature; bh=Gq7PPKJ+EgE3jwAlynW/VJ2gYYyVf60pG8GkTRfW1OY=; b=PtxQ5hl1SQM30VXY+fACvqYe/UBK0XhDB+W0S8ouQ8XDfaFDtrryEoIckucahT6guIA74C 4+yg+o3MmwIcBZzeOSFaHRwjUruzlHFCFu7395DE4UAJnFBxO2KrODRF+NPltMGdClYm4X Id9KrZDF7WHINpVw4LRquxsq3n23/ZwkZF2QdHkR/rwGEy2boh5hGaYettny4oP0sKO9FT TwQGCN4dV8ehIG4KUEDIxMx7ABwTW4f1waMlOc2DLCczYP6qMd+4kasRJNxTExhPAzWp9o sxt7iGt+N49ZZEb3tZYb6nUIhrQyqAmhVQPSGBiLAeYwUZ/UZdkfDJYZhM4v+w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626529331; a=rsa-sha256; cv=none; b=GNjithPuCsi3GCYN48SwNDeNG9YzARXcCoZhtMRg4WL0EEbjtt30BpqzalTz4dDLhhvVsu QajyT8csRpK0jkFYlSA4C6Zr3KcL1vQVzWu9tS0jDdqE9yOTUvPcRvyVPAIwVwPzJLbM81 zaWmS2iwmv+h+zsxAZfAek4N78C+gf27LtduImxg/aCDlr/5TnRjyycOTUK6hrE6eoahCd pWSfltmLLzRBK1NGjq1a6VJxG4ts2b+ab+m9M9PVIT1ptFWMrQiA/roAYn5k/7vKyAf8NA LQGjBkErYano5mA+mXEdVVahgdZFjJBlUSYVgTP4+0zXJacfuz7x7YxkLZl5Ww== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=EgVqTsR8; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -0.81 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=EgVqTsR8; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: AC9C01B222 X-Spam-Score: -0.81 X-Migadu-Scanner: scn0.migadu.com X-TUID: Ad3p+EhROpjg Bhavin Gandhi writes: > I was trying to understand your change. So, when we call > `org-agenda-todo', it calls `org-todo' which adds the > post-command-hook. This hook is supposed to run when `org-agenda-todo' > finishes, but instead of that we call it directly. This makes sure that > the change is recorded in `buffer-undo-list'. You are almost correct. To be able to use undo from agenda, we must have all the changes happen inside org-with-remote-undo body. Only then the changes are recorded into agenda's buffer `buffer-undo-list'. post-command-hook, if ran after `org-agenda-todo', will only record changes in the actual org buffer's `buffer-undo-list', but not inside the agenda's `buffer-undo-list'. > Sorry if that's too much to ask, but why don't we need something similar > when org-log-note-how is 'note? Can you please help me understand that? > I tried reading org-add-log-note and org-store-log-note, but I think I'm > missing something basic here. AFAIK, it is quite hard to do with current log note implementation. `org-add-log-note' itself does not record the note text. Instead, it only creates and pre-populates the note buffer and returns the control to the function calling `org-add-log-note'. Regardless where we call `org-add-log-note', the actual note text will only be added to the org buffer when the user presses C-c C-c in the note buffer. And the user input will only be possible after the current command (in our case `org-agenda-todo') finishes. Thus, user note will always be added outside `org-with-remote-undo' and cannot be recorded by agenda. IMHO, the proper way to handle this would be rewriting the log-note code using recursive editing. But that's not a trivial change and should be implemented in a separate patch. > Also, should this line from org.el (org-store-log-note) be removed? > > ;; Don't add undo information when called from `org-agenda-todo'. I think so. It appears to be irrelevant to current state of the code. Someone forgot to remove this comment in one of the past patches. But removing the comment should be a separate patch itself. Best, Ihor