From mboxrd@z Thu Jan 1 00:00:00 1970 From: Allen Li Subject: Re: New feature? Remove duplicate subheadings, preserving order Date: Mon, 1 Jan 2018 15:04:13 -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]:58319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eW97v-0002cn-M7 for emacs-orgmode@gnu.org; Mon, 01 Jan 2018 18:04:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eW97u-0005Fu-Fe for emacs-orgmode@gnu.org; Mon, 01 Jan 2018 18:04:15 -0500 Received: from mail-qt0-x236.google.com ([2607:f8b0:400d:c0d::236]:35930) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eW97u-0005Fg-BO for emacs-orgmode@gnu.org; Mon, 01 Jan 2018 18:04:14 -0500 Received: by mail-qt0-x236.google.com with SMTP id a16so61105920qtj.3 for ; Mon, 01 Jan 2018 15:04:14 -0800 (PST) In-Reply-To: <87tvw5cu5t.fsf@nicolasgoaziou.fr> 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: Nicolas Goaziou Cc: emacs-orgmode@gnu.org On Mon, Jan 1, 2018 at 10:26 AM, Nicolas Goaziou w= rote: > Allen Li writes: > >> Org mode is fundamentally an outliner, and one often makes lists with >> an outliner. Filtering out duplicates from a list seems to me like a >> common need. > > AFAIK, this is the first time this need is expressed on this ML. There > is no equivalent in "org-list.el" either. > > Anyway, I'm not questioning the usefulness of the feature in your > workflow. AIUI, in your implementation, duplicates are headlines with > the same title, but without considering TODO keyword, priority, comment > status, tags or contents. So, > > * DONE Summary :Alice: > * TODO Summary :Bob: > > are duplicates. Isn't it a bit too tolerant? We may be able to find > a more general function that still suits you. I see this feature as primarily being useful on lists. So for example: * Things to buy ** cabbage ** milk ** carrots ** milk I don=E2=80=99t know if a more intelligent way of handling tags and todo keywords is worth the extra complexity, but in the use case that I imagine it makes sense to match using only the heading/list item: * Things to buy ** TODO cabbage ** DONE milk :store1: Maybe I forgot a tag here. Oh well, I already bought the milk. ** TODO carrots ** TODO milk :store1:store2: > >> I wrote such a command to support some of my work flows, and I posted >> this here because I think there is a possibility that other Org users >> might also find it useful. > > You didn't answer to any of my suggestions, tho. Are they fundamentally > wrong? I.e., wouldn't warning instead of deleting more useful? Or would > it make more sense to include contents when looking for duplicates ? In > the latter case, maybe a prefix argument could toggle headline check and > full check. Since the point would be remove duplicates from lists, I don=E2=80=99t thin= k warning is very useful. I would want to remove the duplicate list items, not get a warning about it and delete them manually. Perhaps that would be a useful additional feature however (like uniq -d). It doesn=E2=80=99t make sense to include the contents because I see this as primarily being useful for list items. In particular, we would want to ignore log entries and properties for the sake of matching (intelligent property or logbook merging might be useful, but adds complexity). I don=E2=80=99t think doing a full text check is useful, but if someone has= a use case for that, please speak up.