From mboxrd@z Thu Jan 1 00:00:00 1970 From: Allen Li Subject: Re: New feature? Remove duplicate subheadings, preserving order Date: Tue, 2 Jan 2018 13:28:04 -0800 Message-ID: References: <87a7xxx5c5.fsf@nicolasgoaziou.fr> <87tvw5cu5t.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWU6Q-0002q1-Dk for emacs-orgmode@gnu.org; Tue, 02 Jan 2018 16:28:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eWU6P-0003yw-GH for emacs-orgmode@gnu.org; Tue, 02 Jan 2018 16:28:06 -0500 Received: from mail-qt0-x234.google.com ([2607:f8b0:400d:c0d::234]:40740) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eWU6P-0003yj-BC for emacs-orgmode@gnu.org; Tue, 02 Jan 2018 16:28:05 -0500 Received: by mail-qt0-x234.google.com with SMTP id u42so64639342qte.7 for ; Tue, 02 Jan 2018 13:28:05 -0800 (PST) In-Reply-To: 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: Florian Beck Cc: emacs-orgmode@gnu.org On Tue, Jan 2, 2018 at 7:28 AM, Florian Beck wrote: > >> 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 subtree= s > (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. It sounds like this problem might vary too much across use cases to generalize and include in Org mode because... > > What I'd like is a function finds duplicates according to scope, match (a= s > in `org-map-entries') and a user defined function. This function should t= hen > 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". You=E2=80=99re requesting a different feature, removing duplicates across a= ll agenda files. My initial proposal was just for removing duplicate direct children (whether by heading or full text pending discussion) under the heading at point.