From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 2ANfOEWx5mDiAQAAgWs5BA (envelope-from ) for ; Thu, 08 Jul 2021 10:03:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id eK0KNEWx5mCEBAAAbx9fmQ (envelope-from ) for ; Thu, 08 Jul 2021 08:03:17 +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 335D52D007 for ; Thu, 8 Jul 2021 10:03:17 +0200 (CEST) Received: from localhost ([::1]:56170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1P07-00035I-Sl for larch@yhetil.org; Thu, 08 Jul 2021 04:03:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38324) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1OzF-00033r-QZ for emacs-orgmode@gnu.org; Thu, 08 Jul 2021 04:02:21 -0400 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:39701) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m1OzE-0003SU-9C for emacs-orgmode@gnu.org; Thu, 08 Jul 2021 04:02:21 -0400 Received: by mail-pj1-x1029.google.com with SMTP id p14-20020a17090ad30eb02901731c776526so3047247pju.4 for ; Thu, 08 Jul 2021 01:02:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version; bh=29bS8g+yTcyXzy9z2ptXmZ65646eSpxj2QHp5fkrPYw=; b=WYIFe9HSt1mISD0NdJ950iUtm/7NMWCbpL/sMhcOitzA8zJa8hHEr0KlIcPf2edqTI Tvl5UiEmu6yCrb4U4ZABqOTt1KNJQgnWIofsNuQZoh9jG1uqc8C8wWZ6Sd0Jd/agw9rD JS1yaJu1MttQY4ExwwS0+tF6xj2aElO7+XYgtj6LYgskUV1TZyQ7e6/Cd87dM3JQ8xHP MQl2hEgBxKVC6+hu6X9QlLiyJW9ZT2WPhBIYVAV+C+jeZrX1hFw/frtx02oWzxAnnm/e JMeltKyWQRbJUcFtHSBSwT+0xNMPif1mqNKg3zJTWTRJta0J9hEFOqtl9mteUV9HC8Tx WLWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version; bh=29bS8g+yTcyXzy9z2ptXmZ65646eSpxj2QHp5fkrPYw=; b=AFZKHrhptVXnETNY3BDAcfj85nHkl4uVwQ16mpnf0Im6IEeVNuDYsQEgGchBYUpB3R D2V5yX4laq2gZVQ7Y1X152KsEGnWo6uoGfyS2gvzk0hVePS4VbR7tCD6VN49YVSR1I2H V1BLrSlUHHoKqvq1g1NB4aX6lbS693JpHPreQjGmKgnuZic5pOm+D/hEe6mDilb/obCT JR34uflYF8w4a/sD+j76xFjp/RSGhUrbGTKMRNopSYXNvrq4Td4TQ7UmjRabBHk/f0bg BUKZ+T+jFKrfktybn6++pPjKBDSGpgoERoVnfqeIEBWNXgo2+YjfHmeZ791Wb/Rk1CB2 TYTg== X-Gm-Message-State: AOAM530YEiANc/UiFgdGBdv7yDlkWhBB5vGOVsx3t60UgrpE8SJlyn7C v/MFrqtCjuG0BcUG6kWJ7673IVNeZ2U= X-Google-Smtp-Source: ABdhPJwlpqzwNitqIw5+5LI7FDdyR4Tiv2cbmeKcHQ5wYXAMqB7cQhIj04Oh9hhZOEKcvOmfmb8Uyw== X-Received: by 2002:a17:90a:9205:: with SMTP id m5mr3597778pjo.172.1625731337283; Thu, 08 Jul 2021 01:02:17 -0700 (PDT) Received: from tim-desktop (106-69-111-137.dyn.iinet.net.au. [106.69.111.137]) by smtp.gmail.com with ESMTPSA id g141sm1650728pfb.210.2021.07.08.01.02.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 01:02:16 -0700 (PDT) References: <87lf6h7ueq.fsf@gmail.com> <87o8bdljwn.fsf@gmail.com> <87y2ahi6zo.fsf@gmail.com> User-agent: mu4e 1.5.13; emacs 28.0.50 From: Tim Cross To: Marco Wahl Subject: Re: [WDYT] org-attach-sync better remove an empty attachment directory? Date: Thu, 08 Jul 2021 17:56:17 +1000 In-reply-to: <87y2ahi6zo.fsf@gmail.com> Message-ID: <87sg0ptere.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=theophilusx@gmail.com; helo=mail-pj1-x1029.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=1625731397; 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=29bS8g+yTcyXzy9z2ptXmZ65646eSpxj2QHp5fkrPYw=; b=a9hRYWPxTPqYZ1xm0tlVyIG7pKAgHNnxftKY1JlnIq1tnpwuTj5QSw4qjrM6J3zaSHVfQP nt5NAN8+gCPr6CZrox0Er4T+JEOaim8legbmiA717hueMZDmSIDfGGNvZqXr4TyHxSpwU+ cuUFY5yKibFK96jhWE1v8e8q7kGRT+pP+jBDUCCzuqqXCH5ChfTLaDGq/IyApzUf+Uwj9H e3veGUAOMp5A7H4CsJxsuHcpLBo9KRLpVDfp+53KHB9cy+K6kg1V88oBuTQ29jppwhWcEZ RxoTcJAVMROkdJ6bsmu2G36KJCNvUMCNJmXC8FLORbpFXuPoTs/xXsy00i/YSQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1625731397; a=rsa-sha256; cv=none; b=bH5OkWjfcBOPfpYdmpMvxIw/MS8dsFD5HUOcdL90mXTyQHww79dA9ZcK47c0fZyk5kUf7w 11VBnGVCA4cRBnzRUc/l4RAy7+Kkhv/3LN3EtgreZv5jNu+FNmMMOI4GJhOf+WaaAIyzbl sCEW3OSrnz77oIjGlZ/prDumURZ1w8I1jMGEniWF8ozT2YCY8yUK3pO3gw2d/m/eIHMYob //vhGq5nrKcCn16ADiQPHgQUU4JB2M9Ktr6P//iIeR5ff+H0PahF+77gqyTQv1xe4czPnq nnWayXad+k8vqChdReEXm+8wc+sZnd1HQnKrB+ajKeZFz/DVLSbtmQbC+K7ADQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=WYIFe9HS; 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=WYIFe9HS; 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: 335D52D007 X-Spam-Score: -2.11 X-Migadu-Scanner: scn1.migadu.com X-TUID: /jvrrpUabzjk Marco Wahl writes: >>> 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.) Agreed. > > 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. > Not as confident here. I can imagine workflows and other external scripts which might expect a specific directory structure that could be broken if a directory was removed (even when empty). Hence my suggestion it needs to be something you can turn off. >> 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. Appreciate the problem with far too many customization options, but when it comes to software 'automatically' doing something, like removal of an empty directory, especially when it might not have been responsible for creation of the directory, it is better to provide some way to allow the user to turn off the behaviour. I would default to having it enabled though. -- Tim Cross