From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id SA2jNP4rK19sZwAA0tVLHw (envelope-from ) for ; Wed, 05 Aug 2020 22:00:30 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id GF+FMP4rK18cAgAAB5/wlQ (envelope-from ) for ; Wed, 05 Aug 2020 22:00:30 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 46D829400BF for ; Wed, 5 Aug 2020 22:00:30 +0000 (UTC) Received: from localhost ([::1]:52912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3RSV-0006fH-C7 for larch@yhetil.org; Wed, 05 Aug 2020 18:00:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36486) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3RRy-0006es-Eb for emacs-orgmode@gnu.org; Wed, 05 Aug 2020 17:59:54 -0400 Received: from mail-il1-x12c.google.com ([2607:f8b0:4864:20::12c]:39433) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k3RRw-0005iD-5J for emacs-orgmode@gnu.org; Wed, 05 Aug 2020 17:59:54 -0400 Received: by mail-il1-x12c.google.com with SMTP id z17so23639958ill.6 for ; Wed, 05 Aug 2020 14:59:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=felesatra-moe.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gkGg8KfQLi/rKxxKvtA1gNjvOZOliREGsjvnsnQtu78=; b=FY6++d4ivvwVFuhiEAKpwj20ohJxNBDtDl8eI8Jk7WMkdvW2cdXj/ZWQXs0iB0cMHB nNHcWbSqmCp5tFM+sGgurb5Ahg5w5/Uzz29/4Ngrcw6LXsng701e50e1eZlG5wDoK1K2 QXHqglQ4ZLsDlCHVM2NmW1DMToMSdGKbnUEiEgEurpkp6Jqbl60F55IkqfJiQYpIaBJW 5GTVJhhVX3JmHcLTv3NRpNCO+1RbXQtHG4XX4K29HBHUOC7AP9iq+32MhoQr/Nnm8AKb 0d2cNzc9WSpk31KzviUn0d1d9mhunhVqUsX1FFVyP6iwqrdE2Jx9WiePAiJMN///+YOO 4lwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gkGg8KfQLi/rKxxKvtA1gNjvOZOliREGsjvnsnQtu78=; b=FByucE4t2nBwAMvCtwgi1vdLn8YgMYCgF2TyREVq9pvl88UjGesKBqS93g8uZLB33g 5yrNc6upZkGwFeU/nM3uw0HqYtli3xQdraUuU0wFbAhedMHqWXO7Z42g5hzebZZHwf0o z8SJ5NDLoNWD9ZSJkr9X98q4jJS2CnYGygN2L/6nmg/sPfHPDGoPIcDJ65iPueM/S6Qq +bpn0L8yZJRs6p7SLcVO63Vk4//dag5cewIuGwkFXgzVaXuisDeqPqMgqj4FT60BR3yR v0DggRdHbbODXIoAjypzq1LK4Yv+kQKyTx92VjUYNxXnYoHfsL/Y1bCiTwAI9pCN1HyS BNfQ== X-Gm-Message-State: AOAM533yfsbrl1P06zD+2yy1XX/wq09hriZ3+uCyHMlzb08LVCxuY/s/ 2N/2LEZjr4UDBIdh/Lx1yMkPA2IWhifW73i7j+irtw== X-Google-Smtp-Source: ABdhPJwSXdELOBks1Pqi6qt0UHi6iN5it2xduuVY/KOgsuCebb8az7dJDn8qZtnpV/gLMjywx16Gf7SytLW1CqdAPhg= X-Received: by 2002:a92:d607:: with SMTP id w7mr5973105ilm.149.1596664790043; Wed, 05 Aug 2020 14:59:50 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Allen Li Date: Wed, 5 Aug 2020 21:59:39 +0000 Message-ID: Subject: Re: Delete duplicate subtrees? To: David Rogers Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::12c; envelope-from=darkfeline@felesatra.moe; helo=mail-il1-x12c.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Org-mode list Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=felesatra-moe.20150623.gappssmtp.com header.s=20150623 header.b=FY6++d4i; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -0.21 X-TUID: zrdcX2IOfTHj On Wed, Aug 5, 2020 at 6:16 PM David Rogers 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 >