emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Allen Li <vianchielfaura@gmail.com>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: emacs-orgmode@gnu.org
Subject: Re: New feature? Remove duplicate subheadings, preserving order
Date: Mon, 1 Jan 2018 15:04:13 -0800	[thread overview]
Message-ID: <CAJr1M6eZ9wiQP+mB8AzS5G3nHmTb_X8BGc+ceSykKLstmwviFQ@mail.gmail.com> (raw)
In-Reply-To: <87tvw5cu5t.fsf@nicolasgoaziou.fr>

On Mon, Jan 1, 2018 at 10:26 AM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> Allen Li <vianchielfaura@gmail.com> 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’t 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’t think
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’t 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’t think doing a full text check is useful, but if someone has a
use case for that, please speak up.

  reply	other threads:[~2018-01-01 23:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-01  2:42 New feature? Remove duplicate subheadings, preserving order Allen Li
2018-01-01  5:55 ` Marcin Borkowski
2018-01-01 10:04 ` Nicolas Goaziou
2018-01-01 11:59   ` Allen Li
2018-01-01 18:26     ` Nicolas Goaziou
2018-01-01 23:04       ` Allen Li [this message]
2018-01-02  4:07         ` Adam Porter
2018-01-02  7:40           ` Allen Li
2018-01-02 14:36             ` Robert Horn
2018-01-02 21:34               ` Allen Li
2018-01-02 16:36             ` Nick Dokos
2018-01-02 21:22               ` Allen Li
2018-01-03  7:24                 ` Adam Porter
2018-01-03  7:40               ` Adam Porter
2018-01-03  8:19                 ` Ihor Radchenko
2018-01-03  9:39                   ` Adam Porter
2018-01-02 15:28       ` Florian Beck
2018-01-02 21:28         ` Allen Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJr1M6eZ9wiQP+mB8AzS5G3nHmTb_X8BGc+ceSykKLstmwviFQ@mail.gmail.com \
    --to=vianchielfaura@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).