From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 4MfhNG4/5GVGWgEAe85BDQ:P1 (envelope-from ) for ; Sun, 03 Mar 2024 10:14:23 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 4MfhNG4/5GVGWgEAe85BDQ (envelope-from ) for ; Sun, 03 Mar 2024 10:14:22 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="mESXdDK/"; 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=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1709457262; 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=FmvXgLAFhQoE24LBdPlM/gS3ky3kIVuoMtKM3D6BrM0=; b=nq271ywrmW4U/ccA8jN35DwSDSqXFDhEjw7pNdcz3K4/ZKF8NAEkVeMchdamGhoRycxuPO QBsahFfZP5FJDeIeR+UJZZ1cNtRXD11JtKrp90I0NXBOiWwmo6UcXeib7jNQuhKw5mFaH/ hI73hRNQnoWCFvYObPkhSetK8f0XAFdjS350DKBsbgIT+4lEYr3GGYqnujbIudMG6TuRhJ ZNeVJT2B3qMQq/oWrcEmw+L6Qzs8fz5uG6VY4v89x0DQQ9kfKpoW5xd9xQRoVNAMJhITU+ nt4ol0Mc+kPdezSwV9zEwjRbAyJEx60kweLLCRehLkYxIVU/yILa5RMyQSUXRQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="mESXdDK/"; 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=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1709457262; a=rsa-sha256; cv=none; b=DFDDtyUbZOpXWpXCHX1Wz6BXHOvm6koE6FR+17tDFTlQixaLesUAy/NPmHl3VuqNdEXS8i J14vyXa/PRht89rGRFBPwF6RnXFR442agEemo0AbBVYq6YndbgV2/BYrIdwM6bfxDcfKJZ 6y3nLCX46zNM1nurqtBhHS35EH8t6cxZP6NjIrorPoyz6FQnkBRqgCpCFuY2qEmkfnotuy l+2OnRLcP+9ibdbin0s3sqwPQfludQa2mGXthH7M0UEkUB+jdWH+NyLPJjOCixowVhXut9 D5YcKmEkuomYvYmMGl8cLDhGvl4UKKps+8J+6EvZs5NMDGL6APCatSyjGjTQzg== 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 80279362FB for ; Sun, 3 Mar 2024 10:14:22 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rghuG-0004om-6Y; Sun, 03 Mar 2024 04:13:16 -0500 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 1rghuE-0004oH-B1 for emacs-orgmode@gnu.org; Sun, 03 Mar 2024 04:13:14 -0500 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rghuD-0001t2-93 for emacs-orgmode@gnu.org; Sun, 03 Mar 2024 04:13:14 -0500 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-6e5a50d91b4so3220988b3a.2 for ; Sun, 03 Mar 2024 01:13:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709457191; x=1710061991; darn=gnu.org; h=content-disposition:mime-version:message-id:date:user-agent:subject :to:from:from:to:cc:subject:date:message-id:reply-to; bh=FmvXgLAFhQoE24LBdPlM/gS3ky3kIVuoMtKM3D6BrM0=; b=mESXdDK/jtVWFEzWAiugzMbzK2MwFGPZmBehe3lGaDeZ5HxRdlFb/GrPaqr6gPu6l2 sSjtZjX61e2qfv29Q3Jug5kA440YS/7ST6PqPlOD2j3CUPbwpCMNX6ZudhVMzGs05zyx XZm+fliIig9LC/PZ2f2hmt1GzQ90j9woLDYP42E8A2QQsqKXioRhJTCRlIOY2KGJiF7W 261beCxQ5HAkaCQ4HHFbSOc6+tSSQWdjk+piE+xtu8YztzVmhrAiydirjPEGns7p+ugd LPk2yBno5mbIAfjgjyBv3L1jCfFDLslKn1Jr/HxG5vB4UfX3saL4/cVwc9FRicYEghmj n7Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709457191; x=1710061991; h=content-disposition:mime-version:message-id:date:user-agent:subject :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FmvXgLAFhQoE24LBdPlM/gS3ky3kIVuoMtKM3D6BrM0=; b=Wwh3yHgbtS+WvE3jGO9pVuo+1ehaf9KxWsQIkD6nptd+bhHsPORSbkn9xzYeozQe+Q B9yTfmk2bP/IKSN/374EWHl1M+HHFiUC81WB1htsvEoYHhdphV+USLS3EqJNkkcAWgXk MHm1RjnL6nC1Azuk0zPwCCXu+QbI3j2/yllsXY5OMH8XJaCI5g+suV+7bCLbUNI5za5K r7xpApFwmlvZrpWL7UR8COwU3axHdo+D/lM0Msar2dTKSisvwA51WyusBjHyFfvOrv/G 95qau2r/JtWuenbUHCYQeSnO/6AKYu2yOo/Il4ho9ctetO/YrsRGqAMPoJRgxuM178rF i03w== X-Gm-Message-State: AOJu0YyR/89JIExLR7GpnwX0vDDOXypwHUyhCnenlyZ7iH6adMnO5vNy 0HKNZ8SxKZ2SdULVrGP52VdzOJubNeyTc4UTKgYDLLGsaD6CMhhmy6IsIGxl31Y= X-Google-Smtp-Source: AGHT+IHF3cFs4DyPZEHK+riLPCeKS7zeny97yXTiEv1aKvwn9nxkXdItQ5dcst8Azejegx+syZu5tg== X-Received: by 2002:a05:6a00:1898:b0:6e5:696d:9eb8 with SMTP id x24-20020a056a00189800b006e5696d9eb8mr8512570pfh.3.1709457191300; Sun, 03 Mar 2024 01:13:11 -0800 (PST) Received: from Proteus (ppp121-45-201-152.cbr-trn-nor-bras38.tpg.internode.on.net. [121.45.201.152]) by smtp.gmail.com with ESMTPSA id x23-20020a056a000bd700b006e04553a4c5sm5469651pfu.52.2024.03.03.01.13.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 01:13:10 -0800 (PST) From: Anand Deopurkar To: Org Mode List Subject: [PATCH] org-agenda.el: Fix org-agenda-write to avoid duplicates User-Agent: mu4e 1.12.0; emacs 29.1 Date: Sun, 03 Mar 2024 20:12:52 +1100 Message-ID: <87r0gradbf.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-agenda.el-Fix-org-agenda-write-to-avoid-duplicat.patch Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=anandrdeopurkar@gmail.com; helo=mail-pf1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -9.56 X-Spam-Score: -9.56 X-Migadu-Queue-Id: 80279362FB X-TUID: uJmmu7wBxCqn >From a269ee1d657ea11f998d294169cd9a88618409fb Mon Sep 17 00:00:00 2001 From: Anand Deopurkar Date: Sun, 3 Mar 2024 16:38:43 +1100 Subject: [PATCH] org-agenda.el: Fix org-agenda-write to avoid duplicates * lisp/org-agenda.el (org-agenda-write): Make sure headlines are not duplicated when writing to an `org' file, even if they are repeated in the agenda view. For example, a headline may appear multiple times in the agenda view (for example, if it has multiple time stamps). But org-agenda-write should write it only once to the output `org' file. TINYCHANGE --- lisp/org-agenda.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 8cb3496ca..798ef1a10 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -3641,11 +3641,12 @@ the agenda to write." (goto-char p) (setq m (get-text-property (point) 'org-hd-marker)) (when m - (push (with-current-buffer (marker-buffer m) - (goto-char m) - (org-copy-subtree 1 nil t t) - org-subtree-clip) - content))) + (cl-pushnew (with-current-buffer (marker-buffer m) + (goto-char m) + (org-copy-subtree 1 nil t t) + org-subtree-clip) + content + :test #'equal))) (find-file file) (erase-buffer) (dolist (s content) (org-paste-subtree 1 s)) -- 2.43.0