Jelajahi Sumber

org-compat: Silence byte compiler for Emacsversion < 28

Check availablility of function directory-empty-p directly instead of
relying on Emacs version.

Thanks Maxim and Kyle for the help.  See
https://orgmode.org/list/87pmun8t2o.fsf@kyleam.com/ .
Marco Wahl 4 tahun lalu
induk
melakukan
3664447eb2
1 mengubah file dengan 6 tambahan dan 6 penghapusan
  1. 6 6
      lisp/org-compat.el

+ 6 - 6
lisp/org-compat.el

@@ -74,12 +74,12 @@
 
 ;;; 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 files."
-      (and (file-directory-p dir)
-           (null (directory-files dir nil directory-files-no-dot-files-regexp t))))
-  (defalias 'org-directory-empty-p #'directory-empty-p))
+(if (fboundp 'directory-empty-p)
+    (defalias 'org-directory-empty-p #'directory-empty-p)
+  (defun org-directory-empty-p (dir)
+    "Return t if DIR names an existing directory containing no other files."
+    (and (file-directory-p dir)
+         (null (directory-files dir nil directory-files-no-dot-files-regexp t)))))
 
 
 ;;; Emacs < 27.1 compatibility