From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id kHgiIPE+FGHcpQAAgWs5BA (envelope-from ) for ; Wed, 11 Aug 2021 23:19:45 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id KJeYG/E+FGERTgAAbx9fmQ (envelope-from ) for ; Wed, 11 Aug 2021 21:19:45 +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 C599517877 for ; Wed, 11 Aug 2021 23:19:44 +0200 (CEST) Received: from localhost ([::1]:44824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDvdX-0005pw-Rq for larch@yhetil.org; Wed, 11 Aug 2021 17:19:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDvbz-0005ph-AJ for emacs-orgmode@gnu.org; Wed, 11 Aug 2021 17:18:09 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:42506) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mDvbx-0005Zk-Md for emacs-orgmode@gnu.org; Wed, 11 Aug 2021 17:18:06 -0400 Received: by mail-wm1-x32c.google.com with SMTP id w21-20020a7bc1150000b02902e69ba66ce6so2934098wmi.1 for ; Wed, 11 Aug 2021 14:18:04 -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:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=CjjhKogw3DQBX2B9xsxD6QaNJY3O9q/XYMiPlBbcNj8=; b=P/NK8ZJahe0bcAdXiEwQ+NBReafk4zfBYzwhHA9rM+0R3UqjdGmuBdCyaLc4tsShrq gR/kpjb1mZf+s0Ug4n2ywroVkefDP6ihw3RWNzLrjAtC2IiWhHF1fWVsYm7AFSFS91hY ymMukeOi03dzk+tzEe9pGnubkz5sLh+lpz2KyVW+/rSk3ignRnUxqTmGwFi1TKdoB9sN S9msSIMHBE/EH0H/U6rRAD8i+WVjdkO3pUBXDTdMIKn0zqbupu425ntIgR06X+8hMtQF kXUsXBUupIYMUw9yz3j6NaiplYj4IgUmCeQwpWDV/Po57wbHOCw0pAHDExNYd80KGOsu o/NA== 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 :in-reply-to:message-id:user-agent:mime-version :content-transfer-encoding; bh=CjjhKogw3DQBX2B9xsxD6QaNJY3O9q/XYMiPlBbcNj8=; b=adHYpRF8iZEn7cr+px2E3aKF3tOg27Tr+BHlN/S/Azrc770PGKONGeIsgUrYd+XS7D IIe3TApmBo8oFybMXffDVQZTnB9sEUkz1/m8fwc7PE/YvryTvJID+uK/HnntTA6ublZ7 B/SkYDdx1L+hOeW9J4859Nc+4Z1Q5+g7Ro81UCCl5rHFzRi58zO/SAKDsSEU4Pb4gKvd He1tg7FeWODbVPfOkCe8mj376f+E93HLQw4UPBso01P5s+5pBhVnn8AYAOltULYb1MfI HNuXCLCsVh+R6asSZaPnTmSgo7+fLQxxy/DoehbZcfj6YVxklfRTSrjS6kAqOKrd6FkK 5n6Q== X-Gm-Message-State: AOAM530wG3iRVWFqCDzbWsDSHR3eeAzwkvZcKbAHG8lEnSEMxQi046S3 b/7YhYlOnX71F1gHSPcgYw4= X-Google-Smtp-Source: ABdhPJyICbibY+KXERqVFtbdQVKxPht5p7HfJK5EMxAjZCkSPubgLnUxEQid2ebi+S0fU6GfzmoSMQ== X-Received: by 2002:a05:600c:2147:: with SMTP id v7mr516871wml.124.1628716683541; Wed, 11 Aug 2021 14:18:03 -0700 (PDT) Received: from aspire-5942 (p200300d867474300f0f7175b7bfbbbf3.dip0.t-ipconnect.de. [2003:d8:6747:4300:f0f7:175b:7bfb:bbf3]) by smtp.gmail.com with ESMTPSA id j6sm323220wms.44.2021.08.11.14.18.00 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Aug 2021 14:18:01 -0700 (PDT) From: Marco Wahl To: Maxim Nikulin Subject: Re: org-attach-sync uses directory-empty-p (new in Emacs 28) Organization: Marco Wahl References: <87pmun8t2o.fsf@kyleam.com> <87lf593tv0.fsf@gmail.com> <9dd6d3bf-46cc-31a2-aead-3af7d53e741c@gmail.com> Date: Wed, 11 Aug 2021 23:17:59 +0200 In-Reply-To: <9dd6d3bf-46cc-31a2-aead-3af7d53e741c@gmail.com> (Maxim Nikulin's message of "Wed, 11 Aug 2021 23:16:06 +0700") Message-ID: <87lf57y92w.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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=1628716784; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=CjjhKogw3DQBX2B9xsxD6QaNJY3O9q/XYMiPlBbcNj8=; b=BkClBdhoKKICTFXS18sfaIJSYQzZ6fjCxMkuM4HBzlH0Xf2Mi7xxVIzUGkpoG74pM+xHZJ lYJJoRbylhNdpY6rzJUc6YEsWerlhaaMAutddWCIBp8EUNvq6Ke/PyafvTcY5uU0KD6txi czngIjECrkL2XzXiC5hiVnzg8MTafacDrgDzuffF+i0yAFcbbOGA/KtmLNur/dLHucPrSf 6lah+mTh/uRswWqS+//YfRpTU6f/HPJ7KCRVP8jP1dK+AUbmTBUeGAQIvm/KR9K2paxKsS kEMI4+vhj0DEcm+tRYdxy/PCbQ0LmSQIoxHqZGU40dm5MNiPkC3TcCpDEseK+Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628716784; a=rsa-sha256; cv=none; b=X9RZ78g8NJ7/V9wW5XM0KeC3DjBcYg1/MF0DhHaBaJijB1nG9o+qyhpcL3XFlgBVlFc/Iq yCCXqadN2fxXTI9GZIDCeMP2QG2xaWFSlomY1sEu0mhjz9IVlYcZcD1tYzLiueD4IMW2Fj G4oMvuyF9/S38306ko6MQ0oANHw/vhA0Duk91EHsIp1culQ7L2jn3y6fkOUdAVj7QhXJ5r oL7kwEuRqcGGK7SUtjBgyuegbf74/eKOPHb9TrUmVTHG+KRuD9sEEMYABCMCDWfLC7Z4SS WSlC3le2qkklf6Cqhalwd5WKRy4HvlBTUtjAWgZDy7rcnJtT3PYb1yawiGU09g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b="P/NK8ZJa"; 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="P/NK8ZJa"; 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: C599517877 X-Spam-Score: -3.11 X-Migadu-Scanner: scn0.migadu.com X-TUID: RYbKcbEB32HS Maxim Nikulin writes: > On 11/08/2021 03:52, Marco Wahl wrote: >>> 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 argume= nt >>>> 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)? >> 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. > > Unfortunately current code causes a compiler warning at least when > Emacs-25.2 is used: > > Compiling single /home/ubuntu/org-mode/lisp/org-compat.el... > > In end of data: > org-compat.el:1255:1:Warning: the function =E2=80=98directory-empty-p=E2= =80=99 is not > known to > be defined. Thanks. How make the compiler happy? What about adding a declare-function for directory-empty-p? Suggestion for org-compat.el: #+begin_src emacs-lisp ;;; Emacs < 28.1 compatibility (if (version< emacs-version "28") (defun org-directory-empty-p (dir) "Return t if DIR names an existing directory containing no other file= s." (and (file-directory-p dir) (null (directory-files dir nil directory-files-no-dot-files-rege= xp t)))) (declare-function directory-empty-p "files" (dir)) ; <-- NEW LINE TO MAKE= THE COMPILER HAPPY. (defalias 'org-directory-empty-p #'directory-empty-p)) #+end_src Could you please check the compile with this modification? Best regards, --=20 Marco