From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id ACfeDn6pLF+QZQAA0tVLHw (envelope-from ) for ; Fri, 07 Aug 2020 01:08:14 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 4NW3Cn6pLF8rZwAA1q6Kng (envelope-from ) for ; Fri, 07 Aug 2020 01:08:14 +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 B3ADA9404C7 for ; Fri, 7 Aug 2020 01:08:13 +0000 (UTC) Received: from localhost ([::1]:48134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3qrj-0003DD-8M for larch@yhetil.org; Thu, 06 Aug 2020 21:08:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52918) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3qrN-0003Cu-3M for emacs-orgmode@gnu.org; Thu, 06 Aug 2020 21:07:49 -0400 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]:38438) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k3qrL-0004Xf-AD for emacs-orgmode@gnu.org; Thu, 06 Aug 2020 21:07:48 -0400 Received: by mail-pj1-x1036.google.com with SMTP id ep8so86911pjb.3 for ; Thu, 06 Aug 2020 18:07:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=bYso0kuSamOfl9PZdsL3BDkrkviXIaD0Hx7MbV8uTRM=; b=quYYgKge9PDGqmkV+544Q/mtwqhe/ctPXBJfb34l8CUTtHCPY2rWpHSRHP12npEx2G YUcnPSH2wwPXKNhDoj9ZQ4l1y8jxbbf3PVqgKqPcDpAGJDjSTXbos/waTb93JfWTztVX bYnlPQD+Q6wTD8s61Gr9eBqw0vdSFCSVOEE0YGeMqczFAS9d5T/LNpCkbCDxwhvO96j0 8aDZ7+TtExkRPoCrWluVTsgUCglowxni629rQ/zyaNO1M0cCxm3b0kxn9RCCV9hE8aIw q4i19bF6tDQ2dskx5+LY07cntAyxJZ6GAuJaTC5WJPgdEmdWj+2lvR9Oj0clDEKPYeQH PyFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=bYso0kuSamOfl9PZdsL3BDkrkviXIaD0Hx7MbV8uTRM=; b=kggQ3QPSpCA7J9U+xnJIqW/sa/H+GN5k5h1O/eNZac05NAn8Ncd/Q8o2SIy4HT4H+u ciSA71yQ5hXLIxK3pv8mt12KmV4o1t1/SG2hsmBspL5cYitHhQSl3dVsmRf7CBmmz52T 2mV6qkVjFEZjha8UlWWsgmY73Uku7DueUX6CsK11C9KI60+untZ+X0laFfz4NkUDn7Rl VT9gf3U6cH62sMs4CLmNuwtO7Z8Y6utbrgyFLfpy8utgBwepW0jt3pxrYknvdMiFWcUJ bxGlAB+9lYXjpxcDv2d4DNUT1FxsSzMwXcJd64L7uhOOD+iYkMkdH+ZdM51uWUzX0QBv eHeA== X-Gm-Message-State: AOAM533/OIGolP1Z8jNm4IX0R3k9eLCFeYjwDII87DcuUomc4/Mn/wjb RJKoxtGaOMCheuAQxT/NjyCpI74f X-Google-Smtp-Source: ABdhPJxYGBiUdR4wvUayCQiWI3bcCu9nMllDAOekS/njpo8eQnNj/yefaGquopCjVp3RsbEFhJ1gag== X-Received: by 2002:a17:902:7fcb:: with SMTP id t11mr10399714plb.266.1596762465081; Thu, 06 Aug 2020 18:07:45 -0700 (PDT) Received: from localhost (node-1w7jr9qt7sj4zq88x0g26tins.ipv6.telus.net. [2001:569:7c17:1900:c0ad:1d9:fa56:11b8]) by smtp.gmail.com with ESMTPSA id q2sm9931251pff.107.2020.08.06.18.07.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Aug 2020 18:07:44 -0700 (PDT) From: David Rogers To: Allen Li Subject: Re: Delete duplicate subtrees? References: Date: Thu, 06 Aug 2020 18:07:42 -0700 In-Reply-To: (Allen Li's message of "Wed, 5 Aug 2020 21:59:39 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; format=flowed Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=davidandrewrogers@gmail.com; helo=mail-pj1-x1036.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, 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: David Rogers , 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=gmail.com header.s=20161025 header.b=quYYgKge; dmarc=pass (policy=none) header.from=gmail.com; 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.79 X-TUID: XxgRy7lnlVEa Allen Li writes: > 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. > After reading the discussion about the code you provided, it's clear to me that what I need is exactly what the "naysayers" were pointing out - something that definitely scans the full text, and maybe gives notice of what's being changed. I don't have the ability to correctly build in those kinds of things myself. -- Thanks David