From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 6DUaHTPnEmHSLgEAgWs5BA (envelope-from ) for ; Tue, 10 Aug 2021 22:53:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 4GvIGDPnEmEjfQAAB5/wlQ (envelope-from ) for ; Tue, 10 Aug 2021 20:53:07 +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 E290B761C for ; Tue, 10 Aug 2021 22:53:06 +0200 (CEST) Received: from localhost ([::1]:47490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDYkE-0002dw-16 for larch@yhetil.org; Tue, 10 Aug 2021 16:53:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48516) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDYjr-0002cM-Hz for emacs-orgmode@gnu.org; Tue, 10 Aug 2021 16:52:43 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:38814) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mDYjo-0004eo-Jg for emacs-orgmode@gnu.org; Tue, 10 Aug 2021 16:52:43 -0400 Received: by mail-wm1-x32c.google.com with SMTP id i10-20020a05600c354ab029025a0f317abfso2846110wmq.3 for ; Tue, 10 Aug 2021 13:52:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:organization:references:date:message-id :user-agent:mime-version; bh=jxqAfn6ScXIt3CB7xyotlXX1mvX4tX+vF5C0O/mrWtc=; b=vU0qKMHmKtNW18DqEZ1NSrgFnFmyD8kaGuJBxLpRqxPcwasW3Kcue5QfMsLxnsX3Da vpaWxBKmilcJ31xGsCUdt2Zkpf6fXypAKGbicW8pARaC/pVboADXf28vvfGvSepf1ETg 4KklR4c1+0/FblwrPQDSIdz2RBaPlBS6UybH0WjIumvhoqA7jasbqpkfn3e1KvRu7zmG YhrIMda5o1deXWgAUz7t3XgWLnUu5E9P0b9h3iw0Ygq+8W28JbreicVGlAkoaEqCBMs5 jJqcS+GzD34YbBk1tQBmBKpST4EYXUZAB5FzK3LL1jBlWFU4cIFn8hlgkQB5ZhEq9wLa ow1w== 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:organization:references:date :message-id:user-agent:mime-version; bh=jxqAfn6ScXIt3CB7xyotlXX1mvX4tX+vF5C0O/mrWtc=; b=lUqKyuI7Wd7gut5XQYcwjTvcuK9heTCEanE4ott1qLCbo67tEB1+Tk/7K9gDQu2ttv NSEElkh/IUPNiOCk/QQtM4aRi3SJm51gfFRXLcALUOYMgrXJm+Mdv75h8mWknwv+Fg1d u2hm/f9sHhLExtEgRynAE84LwAc7iUgff2eZG/tuzkQCf8tJCDlWPrKwheG6O4DyQ7/w z8oL8H3ZvBRcFpTlLUs3j4wK+49S54l6k8eyWICu2Fzf3i8+srv+H9aaO43ek7dN8uz6 AO7g3XrKT65p0BsJOyXVrm4nBFLM+jIOXRiMrBxdoHrpjK0dQLgiwdKatdnEsV5DdNKV WLzw== X-Gm-Message-State: AOAM533gem6HXHbO0VO/p1gZKAi87RUcjKDos1PzTnt1ZWeSAXE59QTu c8s11hH+WvY/jvpG02xWHWo= X-Google-Smtp-Source: ABdhPJzXtFuqSVlFx3yazMxyyRWmQQVIVN6/YyRZXkAZOIwP/vzfS9OzalDNFHMwa5wFS5GUWh5qHw== X-Received: by 2002:a05:600c:3b94:: with SMTP id n20mr23523107wms.54.1628628758506; Tue, 10 Aug 2021 13:52:38 -0700 (PDT) Received: from aspire-5942 (p200300d8672f9a00e5d0f1d70ce28b92.dip0.t-ipconnect.de. [2003:d8:672f:9a00:e5d0:f1d7:ce2:8b92]) by smtp.gmail.com with ESMTPSA id s17sm3019874wmj.12.2021.08.10.13.52.37 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Aug 2021 13:52:37 -0700 (PDT) From: Marco Wahl To: Arthur Miller , Kyle Meyer Subject: Re: org-attach-sync uses directory-empty-p (new in Emacs 28) Organization: Marco Wahl References: <87pmun8t2o.fsf@kyleam.com> Date: Tue, 10 Aug 2021 22:52:35 +0200 Message-ID: <87lf593tv0.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::32c; envelope-from=marcowahlsoft@gmail.com; helo=mail-wm1-x32c.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=1628628787; 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:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=jxqAfn6ScXIt3CB7xyotlXX1mvX4tX+vF5C0O/mrWtc=; b=mUh0MNjr4Ani3Tw6tq+HR3+h4mG3Iy0ah1KZbLimQAlr2RKBDXh3qCfkyubkHa9hAb6Tyh fnayrfvZO2UIPxSaJ1uMKG8YbSX9+VzEphKuQ+Qb8yelfAE2NUiy/JhDY+/Dvta2p8KYtB ieNX112/Km7iyZrW+6NgDumnv5APYG17/X9CQDCwsg3/p0ULfuXaNJEIQXuxQgLBvhNxeS GcwLmgIESVstb8HdjyWpPLb2COkBfS5xG90DPVLajNp5aKMLJtzDxiS2IGQNPWh1MAe9TQ y1DGnla8QEQ+fMQ0rGqfE3j6IU+0sSS3X6nNpxplliI3tWH5DeS+X3WJL+YnDA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628628787; a=rsa-sha256; cv=none; b=b8NtgYlGPhMlPShWksXXBndKH4CxZycS58SgEYqIUdmBz/wEGXmpdpQENkQZInb4huPJEH nNrNLjc4E7RWM490+PkkLBDZXkdt8y7Lpsuv6BUFqipXViHpInvqKj+3xUgkQ25MttBUJV s3K8/Hl3yjzYe8mI2n2i0CsBkjmps+zY06LyF/c/F1nEQ7NGl+LHG3tDEZ1vHLJ7mai32L 9MIMNcqckV+qxATCKFpbbAq1g4o0qPbqwqMnPPSnM7xHsmVAb12mpPozkZOMIfwWmpRphw hqIibC2BHlhD61fElZpwtORwxJhdiz6biiod/Jv8i8YJudfuMC9o+RhCpn7OIQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=vU0qKMHm; 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: -3.11 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=vU0qKMHm; 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: E290B761C X-Spam-Score: -3.11 X-Migadu-Scanner: scn1.migadu.com X-TUID: OLd/p9PkrjEa Arthur Miller writes: > Kyle Meyer writes: > >> In 61e083732 (org-attach: Possibly delete empty attach directory, >> 2021-07-09), you added a call to directory-empty-p. This function was >> introduced in Emacs's 0806075520 (Add directory-empty-p and new argument >> COUNT for directory-files-*, 2020-11-02) and hasn't yet made it into a >> release. >> >> Could you update org-attach-sync to avoid using directory-empty-p (e.g., >> by inlining it or by adding a compatibility alias)? > Can this help: > > #+begin_src emacs-lisp > > (when (version< emacs-version "28") > (defun directory-empty-p (file-name) > "Check if a directory contains any other files then dot-files" > (when (file-directory-p file-name) > (null (directory-files file-name nil > directory-files-no-dot-files-regexp t))))) > > #+end_src Thanks Kyle and Arthur! Starting from Arthur's suggestion and Kyle's hint to the compatibility alias I put org-directory-empty-p into org-compat.el. So there is org-directory-empty-p now which provides the functionality of directory-empty-p from Emacs 28 for smaller version Emacsen. org-directory-empty-p is defined in org-compat.el. From there org-directory-empty-p can (and hopefully will) be easily dropped when the minimum required Emacs version for Org switches to 28. Thanks again and best regards, -- Marco