From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id oPVsNDOJPGZGYgAAe85BDQ:P1 (envelope-from ) for ; Thu, 09 May 2024 10:28:36 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id oPVsNDOJPGZGYgAAe85BDQ (envelope-from ) for ; Thu, 09 May 2024 10:28:35 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1715243315; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=sMGxjCYbfMQxYaXHqy8m5+7RhxCebXeS6rtQgt7IR9U=; b=r9aWSnJdGtf8S/xneNSnfEOcRGEreU18AjEhIJAzwPSEA/Ej5LAB+ihPD6xm6IEs7z5z+A nMZLjOFS/NQ1HyVDroUb47/ImkGa8/ihQnTRR41UlHjmrmLxP2fkf/yCD4NqSawCPl8t7e Qw4w11hgBVnq5jtmiOcv7QH0DA+TthhxGZSxKyPwQzJXB3v2aCksskvPHQN6Uy7w/3PYLg qAfn9Ex6V+0aeGOcLPvJ76nvjo9CFf/mcomWsh4av9JNW7YQZfcxesLUNUC+THYC9my00V UU84gF0uXyRqKbfVQCLr3NdGffHXdErN9M8RU6eC1mUEqyRA/HUNmrj84bierw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1715243315; a=rsa-sha256; cv=none; b=fAUe4N1BDwhDNDkT3Xhz8P63tlbT+lq9yw39az8aiqSt6DXzFhNCPuh6O2vzIyQghtW5aR Df+XopuJnsrNOfdjqTvsu3iaq3qnBq2Ol57caisdTM6UPgm2kw2FDE3GBf0r4NL8AG05NU AHnM1s+HKxfgKC+ovOyGY6oLtmX766719rrGbHgEwsEVkBzap3CEcrsCCY/XpHvpbqC0RR jctClkqSSM8yyeXTrWTCwAKj2T3nb03lQjiq5LJK/jAva92rEjt143GQhu21ErS+ymH8Qp leggcWeTEeXnNck7tucw43GcTtkdaAIyIcd348XNQdSFXYEijW2W36cems1MtA== 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 933C13BD37 for ; Thu, 9 May 2024 10:28:35 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4z7n-0004km-6Y; Thu, 09 May 2024 04:27:35 -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 1s4z7l-0004kX-IN for emacs-orgmode@gnu.org; Thu, 09 May 2024 04:27:33 -0400 Received: from 62-210-209-184.rev.poneytelecom.eu ([62.210.209.184] helo=sula.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s4z7Y-00053m-Fe for emacs-orgmode@gnu.org; Thu, 09 May 2024 04:27:33 -0400 Received: from localhost (anancy-653-1-9-249.w92-138.abo.wanadoo.fr [92.138.227.249]) by sula.io (Postfix) with ESMTPSA id C01BE5D41C39 for ; Thu, 9 May 2024 10:20:41 +0200 (CEST) To: Org Mode List Subject: Re: [PATCH] Add org-after-note-stored-hook In-Reply-To: (Joris Caravati's message of "Tue, 02 Jan 2024 23:13:06 +0100") References: Date: Thu, 09 May 2024 10:20:40 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=62.210.209.184; envelope-from=tyx+org@sula.io; helo=sula.io X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, RDNS_DYNAMIC=0.982, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, TVD_RCVD_IP=0.001 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: , Reply-to: Joris Caravati From: Joris Caravati via "General discussions about Org-mode." 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-Spam-Score: -5.18 X-Spam-Score: -5.18 X-Migadu-Queue-Id: 933C13BD37 X-Migadu-Scanner: mx13.migadu.com X-TUID: noaOQfUpYRP2 Hello, Is there anything wrong with the patch or with the proposition of adding a hook there? The first I'd like to know for doing better next time (or maybe correcting this one), the second to know if=E2=80=AF I should stop using it. Thanks! Joris Joris Caravati writes: > Hello, > > I've been archiving tasks automatically using > `org-after-todo-state-change-hook' but I've been recently bit with a > note (entering a todo state configured with '@') being placed where the > task was before its archival. > > This patch aims to offer a way to defer the archival after the > note is stored. Actually, I am using it like this: > > #+begin_src elisp > (add-to-list 'org-after-todo-state-change-hook > (lambda () > ;; States configured without mandatory note > (when (member org-state '("DONE")) > (my/org-roam-archive-to-today)) > ;; States configured with mandatory note > (when (member org-state '("CANCELLED" "READ")) > (add-to-list 'org-after-note-stored-hook 'my/org-roam-archive-= to-today)))) > #+end_src > > With `my/org-roam-archive-to-today' removing itself from > `org-after-note-stored-hook'. > > Hopefully I did not miss an existing way to do this. > > Regards, > Joris > > [2. text/x-patch; 0001-Add-org-after-note-stored-hook.patch]...