emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Allen Li <darkfeline@felesatra.moe>
To: David Rogers <davidandrewrogers@gmail.com>
Cc: Org-mode list <emacs-orgmode@gnu.org>
Subject: Re: Delete duplicate subtrees?
Date: Wed, 5 Aug 2020 21:59:39 +0000	[thread overview]
Message-ID: <CADbSrJwB7XgJ2Wd0cpUKdwi8vDhNbJjgAw_58UbRPiyO7+OuKw@mail.gmail.com> (raw)
In-Reply-To: <s0e8setc62b.fsf@gmail.com>

On Wed, Aug 5, 2020 at 6:16 PM David Rogers <davidandrewrogers@gmail.com> wrote:
>
> Hello
>
> I've copied text from several different sources into an org
> buffer, and now I find I have a large number of subtrees that are
> exactly the same. All headlines are at the top level, so there are
> no duplicates at different levels from each other - but there
> *are* some where the headline matches but the contents don't
> match. Is there an efficient way to delete all-but-one of the
> exactly duplicate subtrees, but avoid deleting any whose contents
> are different? (When the large number of exact duplicates are
> gone, it will be easy for me to resolve the partial matches one by
> one.)

Maybe this will be useful to you.

https://lists.gnu.org/archive/html/emacs-orgmode/2017-12/msg00626.html
https://lists.gnu.org/archive/html/emacs-orgmode/2018-01/msg00000.html

You will have to modify the code since IIRC the linked code only
matches by heading and not body.

>
> --
> Thanks
> David
>


  reply	other threads:[~2020-08-05 22:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-05 18:15 Delete duplicate subtrees? David Rogers
2020-08-05 21:59 ` Allen Li [this message]
2020-08-06  8:20   ` David Rogers
2020-08-07  1:07   ` David Rogers

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=CADbSrJwB7XgJ2Wd0cpUKdwi8vDhNbJjgAw_58UbRPiyO7+OuKw@mail.gmail.com \
    --to=darkfeline@felesatra.moe \
    --cc=davidandrewrogers@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).