From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id wDMiOucD42UXbwAAqHPOHw:P1 (envelope-from ) for ; Sat, 02 Mar 2024 11:48:08 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id wDMiOucD42UXbwAAqHPOHw (envelope-from ) for ; Sat, 02 Mar 2024 11:48:08 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="V8A/K2l7"; 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=1709376487; 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=oLEW7jH0R3FhpRF3OjKVke0pXSYPwM2M4OHuuvu43kA=; b=pZvccabWOQLKJMU1iX1iIR7f9KsIKljqJPxC7je4ifxO0SK1psFPnBGfHwt+U0QMakDW1f Gg/ownvP8cBgxvdjRq94gAq5ffCdYNyFBpug2CRhLw/4KVxu9IH9fOkGxU28t67VP8zFwb voUvOwfUPePCMPwAUDicRFrvBh5dgKxulzlML7oIC1Xv41LPJxXDTntfplgNtPSizClcZj 7Z1mauEBu3lt/iOuHm2XpTx8xjTAC6wO/TH3Jkh4DJwiM+H9/HRaczzcnU052Fbf3z7VoX 0pAktKghHpg4+WnvcwHIDAtDUktK2cGmRZm+yDSHLMwlw74dVa/XP3Yrcn1+4w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="V8A/K2l7"; 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=1709376487; a=rsa-sha256; cv=none; b=Nt0otEEcOssJlzC7B19FFjxz1wxpKcGt/pVrhxbP3xSmx4zPLpSTI1mp3wwBFjBvyEaTBi tziz0Gt7JNq5W661Vv9yYyp1z4IU8BwVQ2tyyOH2/CXGjVL5LD8u5t7i7xsJKTZFr0TYtg DN5n6y6PE9rfKjEOySHZVUUoq6f9UT0jo9ZaPA23YbsKLXDtH0RBiIWk0UlkiytgS86S7n FvObaBqXRdeUSc3g39sFvMuckdfsUDyZ5WnAsOfTn+4XZFioKMNyukGLgOP5MnZaZKLhcK bcxXHH6kUqjwcQvp4CmfIe4x0FiFaL36Dtk56s/G/MvR8eF6Ly0xbC1IcSh93A== 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 B4179ED2E for ; Sat, 2 Mar 2024 11:48:07 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rgMtg-0003G9-AY; Sat, 02 Mar 2024 05:47: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 1rgMte-0003Fy-DD for emacs-orgmode@gnu.org; Sat, 02 Mar 2024 05:47:14 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgMtc-0007p2-LO for emacs-orgmode@gnu.org; Sat, 02 Mar 2024 05:47:13 -0500 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1dc75972f25so26866565ad.1 for ; Sat, 02 Mar 2024 02:47:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709376431; x=1709981231; 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=oLEW7jH0R3FhpRF3OjKVke0pXSYPwM2M4OHuuvu43kA=; b=V8A/K2l7OgPL/M6XM0WVYOHatnqZ+vMhqUVdFWPx+obVa9ClWwNGsjZRqh6y4lb4cF VTZbQkf6WQuUtK2EksK+wGTw5ubToG2lOYGYZxAWho75LJPT2bkAPdev38VythOIIgw0 LYlAlB9RxUgoIG6mP9oR/wFp78EJi8y2eImNfvy2PXyAGf5uF23Azrz7nsKVm4TS6rB8 MJ+nJM3k+ji3cENcdl2NUyt12fE79mXeHJ6sHQYNSZ8wArZ+ZnBgJbQI70SvcHPn98xj tV6DUTF+L7O3C/ABj1UgOvfXWpyeieaQQkYfREQfKlV0wFvTivZ4GrC7ZPGMhmVJ3iZM JdxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709376431; x=1709981231; 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=oLEW7jH0R3FhpRF3OjKVke0pXSYPwM2M4OHuuvu43kA=; b=ecVwexwHAFUQO4TTHWQ1qmcXafmsc0IsyxCqeZfPtG2o10TzdqQWpZboKBnYJ8mr0Q vbOPixn63PDK36y3b/bTU5GAk73hlh6KBqovoifpm4noeyVgFmB+dhRpsuMOu4eCO1kW ROw5aiBX7lMlpK1BP///7SyuGqPPdXRTwPkMX34CLydjVi/1G0FyfB/9fTSOL2Pi+icf Wv1okYQbJICh53LpoTv8bGAFvOrl39AkX8OS4r7Ok6GfKww4ey9lE0Wv/Ig0QZgf6sZI /7B167lJ9aP9q3VofN9Y8JlrPJYmfrJ6ZAUIwJgbC89MJfB0jBVgqdrGHMZEEa8/k1jp dtfA== X-Gm-Message-State: AOJu0Yzc1hMsZuH0rK0vtLoYJcklJlfdafzJUC+nNboS9aZnn5uIfyOi 3s5TqlJIxMGgyupeQq9yq3NAMwoJAC/0Ps+4riTcsnrYB7rfJPFlv462wPtJdiI= X-Google-Smtp-Source: AGHT+IHysTWvHZU/ZlKeA99h8qmPihN0wTrZRJ8XA3Gtby+ay9NBTinMcXEdxffkBXnN8o/y63H7DQ== X-Received: by 2002:a17:902:720a:b0:1dc:1df6:48a0 with SMTP id ba10-20020a170902720a00b001dc1df648a0mr3771525plb.66.1709376430876; Sat, 02 Mar 2024 02:47:10 -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 x6-20020a170902a38600b001db86c48221sm5063584pla.22.2024.03.02.02.47.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Mar 2024 02:47:10 -0800 (PST) From: Anand Deopurkar To: emacs-orgmode@gnu.org Subject: [PATCH] org-archive.el: Fix org-add-archive-files to correctly de-duplicate User-Agent: mu4e 1.12.0; emacs 29.1 Date: Sat, 02 Mar 2024 21:46:56 +1100 Message-ID: <87wmqkap27.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-archive.el-Fix-org-add-archive-files-to-correctl.patch Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=anandrdeopurkar@gmail.com; helo=mail-pl1-x630.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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -7.69 X-Spam-Score: -7.69 X-Migadu-Queue-Id: B4179ED2E X-TUID: RyJbh9Prz1bI >From 44b681b82a23f0a475e706d4fab2a46d6aedeea5 Mon Sep 17 00:00:00 2001 From: Anand Deopurkar Date: Sat, 2 Mar 2024 21:24:19 +1100 Subject: [PATCH] org-archive.el: Fix org-add-archive-files to correctly de-duplicate * org-archive.el (org-add-archive-files): Use `seq-uniq' with TESTFN `\#\'file-equal-p' to de-duplicate the list of gathered files. Previously, `org-uniquify' was used. This de-duplicates the file-names, but not necessarily the files. The problem occurs if the list of file-names includes distinct file-names that reference the same file (symbolic links, for example). TINYCHANGE --- lisp/org-archive.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/org-archive.el b/lisp/org-archive.el index 20b962057..e46649fd3 100644 --- a/lisp/org-archive.el +++ b/lisp/org-archive.el @@ -157,7 +157,7 @@ archive location, but not yet deleted from the original file.") "Splice the archive FILES into the list of files. This implies visiting all these files and finding out what the archive file is." - (org-uniquify + (seq-uniq (apply 'append (mapcar @@ -166,7 +166,9 @@ archive file is." nil (with-current-buffer (org-get-agenda-file-buffer f) (cons f (org-all-archive-files))))) - files)))) + files)) + #'file-equal-p + )) (defun org-all-archive-files () "List of all archive files used in the current buffer." -- 2.43.0