[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master ec6a73e0d32 1/2: Fix 'find-ls-option-default-ls' for BSD/MacOS (b
From: |
Eli Zaretskii |
Subject: |
master ec6a73e0d32 1/2: Fix 'find-ls-option-default-ls' for BSD/MacOS (bug#62096) |
Date: |
Sat, 18 Mar 2023 02:32:38 -0400 (EDT) |
branch: master
commit ec6a73e0d3206255fe422cd248d6be959f50aec9
Author: Manuel Giraud <manuel@ledu-giraud.fr>
Commit: Eli Zaretskii <eliz@gnu.org>
Fix 'find-ls-option-default-ls' for BSD/MacOS (bug#62096)
* lisp/find-dired.el (find-gnu-find-p): New variable to determine
if "find" is a GNU find.
(find-ls-option-default-ls): Use 'find-gnu-find-p' and adapt to a
value that works with the default "find" on *BSD and Darwin/MacOS.
Tested on OpenBSD and MacOS.
---
lisp/find-dired.el | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lisp/find-dired.el b/lisp/find-dired.el
index 33376ee4ed9..264c6e3082f 100644
--- a/lisp/find-dired.el
+++ b/lisp/find-dired.el
@@ -50,8 +50,13 @@ than the latter."
:group 'find-dired
:type 'string)
+(defvar find-gnu-find-p
+ (eq 0 (ignore-errors
+ (process-file find-program nil nil nil null-device "--version")))
+ "T if 'find-program' is a GNU find. NIL otherwise.")
+
(defvar find-ls-option-default-ls
- (cons "-ls" (if (eq system-type 'berkeley-unix) "-gilsb" "-dilsb")))
+ (cons "-ls" (if find-gnu-find-p "-dilsb" "-dgils")))
(defvar find-ls-option-default-exec
(cons (format "-exec ls -ld {} %s" find-exec-terminator) "-ld"))