From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Beck Subject: Re: New feature? Remove duplicate subheadings, preserving order Date: Tue, 2 Jan 2018 16:28:42 +0100 Message-ID: References: <87a7xxx5c5.fsf@nicolasgoaziou.fr> <87tvw5cu5t.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59107) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWOV8-0000fm-Nv for emacs-orgmode@gnu.org; Tue, 02 Jan 2018 10:29:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eWOV6-0005kG-2g for emacs-orgmode@gnu.org; Tue, 02 Jan 2018 10:29:14 -0500 Received: from [195.159.176.226] (port=34622 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eWOV5-0005ji-SA for emacs-orgmode@gnu.org; Tue, 02 Jan 2018 10:29:12 -0500 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1eWOT1-0002Vr-6T for emacs-orgmode@gnu.org; Tue, 02 Jan 2018 16:27:03 +0100 In-Reply-To: <87tvw5cu5t.fsf@nicolasgoaziou.fr> Content-Language: en-US List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org > AFAIK, this is the first time this need is expressed on this ML. There > is no equivalent in "org-list.el" either. A way to handle duplicates would be useful, indeed. But a basic function should only remove duplicates that are truly identical (same properties, same tags, same/no content). Still, removing true duplicates from subtrees (AND lists) would be useful. More useful would be a slightly more general approach. I have three kinds of duplicates: - duplicate IDs (which are handled rather poorly), - duplicate content (which often is only almost identical) and - duplicate headings (which usually I want to rectify when they are on the same level of the same subtree) As you can see, a fixed concept of duplication is probably not going to work. What I'd like is a function finds duplicates according to scope, match (as in `org-map-entries') and a user defined function. This function should then display the problem cases (via agenda view?). Then we need a couple of convenience functions like - delete all duplicates but the one at point, - mark duplicates I want to keep, - uniquify entries (tricky; for headlines maybe prompt the user; for IDs, we should check if the ID is referenced from somewhere) - merge entries. But then, I also have duplicates (in content) I want to keep, e.g. one in my notes and in a writing project. So, we'd need a property like "DUPLICATE_OF".