emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Allen Li <vianchielfaura@gmail.com>
To: Florian Beck <fb@fbeck.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: New feature? Remove duplicate subheadings, preserving order
Date: Tue, 2 Jan 2018 13:28:04 -0800	[thread overview]
Message-ID: <CAJr1M6cL22-X3s7wT5eroYTXK8L6F9vD6TcUnkLbGk3rB+osvA@mail.gmail.com> (raw)
In-Reply-To: <p2g8bf$3t0$1@blaine.gmane.org>

On Tue, Jan 2, 2018 at 7:28 AM, Florian Beck <fb@fbeck.net> 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 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.

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 (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".

You’re requesting a different feature, removing duplicates across all
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.

      reply	other threads:[~2018-01-02 21:28 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
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 [this message]

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=CAJr1M6cL22-X3s7wT5eroYTXK8L6F9vD6TcUnkLbGk3rB+osvA@mail.gmail.com \
    --to=vianchielfaura@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=fb@fbeck.net \
    /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).