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 ms0.migadu.com with LMTPS id 8JuPAo2t5mAlhgEAgWs5BA (envelope-from ) for ; Thu, 08 Jul 2021 09:47:25 +0200 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 GC7pOYyt5mBNBQAAB5/wlQ (envelope-from ) for ; Thu, 08 Jul 2021 07:47:24 +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 159CD24BA3 for ; Thu, 8 Jul 2021 09:47:24 +0200 (CEST) Received: from localhost ([::1]:43006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1Okl-0000n8-1K for larch@yhetil.org; Thu, 08 Jul 2021 03:47:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35456) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1Ojg-0000lh-MC for emacs-orgmode@gnu.org; Thu, 08 Jul 2021 03:46:17 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:45614) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m1Oje-0006bT-KK for emacs-orgmode@gnu.org; Thu, 08 Jul 2021 03:46:16 -0400 Received: by mail-wr1-x42f.google.com with SMTP id i8so6233363wrp.12 for ; Thu, 08 Jul 2021 00:46:13 -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=cSresqAGtLjPZe3bPyXKj09WVh9xY6m/Lf++EpYDKfo=; b=GPPwj4sWqJEW0ukFy4DHcML03+kAEw5rKMeLsbAYcX4DliLs+0QzX06RwT1Thy2BJa dR4oxCKTlxpf2N4vPNlcvRbErkhPAS/tz67pJrHKvjdlAQ82gmCi2P+0pdp3+qQleWDK YkNLNmm58NYhGO7A5kOXkJYuVJRo4MpoWT2/B7C4sy+ZMUhA3uLkiZzILScWwynytn+w VjSM2bifIpyjqgumL++8Yo2+Umx1zDELYNUf43XZqxpS2NzsXQcavVAO1kvNxN7Qm2PU PaiYuu2zGS8rF95pCrxPfLSgbrMPrmRlBnwmmjR0a9/zc2fBxhKx+vDnuKFTsyRc1m8y lu+w== 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=cSresqAGtLjPZe3bPyXKj09WVh9xY6m/Lf++EpYDKfo=; b=rMEBXwbx/ZhV/0RNoeWFqtY8IMsGVwYect/xhlJA8TjUWf5itT0q0sU+R28OOhUI6a Y44wRkxzeS286aTQxg4lTRJe50gVKoAT2JDUt7i0sPdyV74cLLlJvn2l09D0UeWg+ZUd 9JZz0gQW2txCeid3kUuIOEp7wwPTkORq1+jJ1ZkApHEgbslVyBIyRw2KrW7yQqr74+Wu VirapARqsz+Foy899Rd5jBnteNek2ykX0ZJqDe6HK2Z5GH+tP788CKajyCQB2cTXtkjc OxLyfEOrBj2VlaVYnNsvjRNyIqbPSRTde+uIq4iOPCGT3e0X0bWrhvx3HnAmn3oEdfPo fiAQ== X-Gm-Message-State: AOAM532ZZQqXdOMKvd1goBuKWfESdJy4qmxKkjQpwHE1z9VO94PtUcHX +CZvVhthPj9neZXltwH4Ysk= X-Google-Smtp-Source: ABdhPJyXSrivHLcQTTA6JNnkaHMoQH7/9WaF7smSyf4l6rmALQvH6S4qDRUZ4zgi4veEgs1CT9TFkQ== X-Received: by 2002:adf:8061:: with SMTP id 88mr32625724wrk.233.1625730372033; Thu, 08 Jul 2021 00:46:12 -0700 (PDT) Received: from aspire-5942 (p200300d86700b600fd4c014bd0557bd2.dip0.t-ipconnect.de. [2003:d8:6700:b600:fd4c:14b:d055:7bd2]) by smtp.gmail.com with ESMTPSA id v30sm1097598wrv.85.2021.07.08.00.46.11 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Jul 2021 00:46:11 -0700 (PDT) From: Marco Wahl To: Tim Cross Subject: Re: [WDYT] org-attach-sync better remove an empty attachment directory? References: <87lf6h7ueq.fsf@gmail.com> <87o8bdljwn.fsf@gmail.com> Date: Thu, 08 Jul 2021 09:45:31 +0200 In-Reply-To: <87o8bdljwn.fsf@gmail.com> (Tim Cross's message of "Thu, 08 Jul 2021 10:34:43 +1000") Message-ID: <87y2ahi6zo.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=marcowahlsoft@gmail.com; helo=mail-wr1-x42f.google.com 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: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1625730444; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=cSresqAGtLjPZe3bPyXKj09WVh9xY6m/Lf++EpYDKfo=; b=RkIvL6CN3/HYSQa/DGT8X5YDVw7GFeRJrQyli7DQo1fJ6WEKN1J9CuE/b9IJ6+cXixckNj gjIS1SH1e5JQ7uca5Kf/nDnTt9jyROYpWN4NSWta0n2cYunlhFt+27tyh2ABq3zk55HmxX Vhv8DuI6EjhoRIdy3zHLzpynB2DmsHxaEneyghlAnCV7AOlRU+0zXgyMzy/SY5x3EW1TRM KFK73bsog5hYEPREV835+BluDNzU194hxew9rj+G444xL8cw0EMBO1t/xPj0hNzRPNlYYs SUYydzFHWBEbA1T0rnX3lRBjK94n4CCkEQOrq6NZYPAFhVu28Fg2Way6Ztbjtg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1625730444; a=rsa-sha256; cv=none; b=eb4SFr91H5d4l5HmCP6nNskQd4BMB1UI1Yrlb/2yDc9rohfbD8oLQ86gTxDA1s+6ZBFIoG v6l8n34OxKsUKl5Z6b6noQ6hMFpShU56cmvyWIjxqksFJZWQ54a5b0faWFuv9FjrcMyu3Z YOs5bYb4aFEOg/x0ika8lgeGsIHMlPVX3oqMq8w6qfUUlGyoBh+nyxOX2BpatwjAUPCs/r Y3ZTpe6BEsj8MzF+26s4572G39Om+OJN0VphHet9C6sdy/WGdOF4/nmNDn/ePOIBHSNDRV RrbrZkK37ZFvN1VrkSMh5obc3oZ6hchjZfweMGKvwe+LmBmJx6dWOFRbgPyU9w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=GPPwj4sW; 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-Migadu-Spam-Score: -2.11 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=GPPwj4sW; 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-Migadu-Queue-Id: 159CD24BA3 X-Spam-Score: -2.11 X-Migadu-Scanner: scn1.migadu.com X-TUID: FwsX7L0Ld+3t >> org-attach-sync can be used to "Synchronize the current outline node >> with its attachments." Which is great AFAICT. >> >> What do you think about letting org-attach-sync remove the attachment >> directory if it's empty? >> >> Rationale: Nobody needs an empty attachment directory. >> > > This seems pretty reasonable to me provided it only removes an > attachments directly which was created by org-attach-sync. If the > directory existed or was created by something external, then removing it > probably should not be done. I think it's too much effort to keep a list of attachment directories which have been created by Org attachment commands. Complexity! (BTW org-attach-sync does not create an attachment directory. It rather checks the state of the directory and acts accordingly.) Please recall that only empty attachment directories would be removed, so removal of a directory--and in particular one that existed before its interpretation as Org attachment--wouldn't be a big deal AFAICS. > Likely this is something which should be controllable via a custom > setting? To be honest I'd rather not make another customizable thing out of it to keep the overall complexity low. OTOH we could easily introduce e.g. customizable org-attach-delete-empty-dirs-on-sync.