From: Manuel Giraud Date: Fri, 10 Mar 2023 20:54:00 +0000 (+0100) Subject: Fix 'find-ls-option-default-ls' for BSD/MacOS (bug#62096) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ec6a73e0d3206255fe422cd248d6be959f50aec9;p=emacs.git 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. --- 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"))