From 19987df00a32cada1d20b544646b0416030038fa Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 5 Jan 2019 16:04:38 -0500 Subject: [PATCH] Add IS-BSD constant Fixes dired gls support on BSD OSes (and not just MacOS). --- core/core.el | 1 + modules/emacs/dired/config.el | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/core.el b/core/core.el index 52a299c74..fe30fd189 100644 --- a/core/core.el +++ b/core/core.el @@ -22,6 +22,7 @@ line or use --debug-init to enable this.") (defconst IS-MAC (eq system-type 'darwin)) (defconst IS-LINUX (eq system-type 'gnu/linux)) (defconst IS-WINDOWS (memq system-type '(cygwin windows-nt ms-dos))) +(defconst IS-BSD (or IS-MAC (eq system-type 'berkeley-unix))) ;; diff --git a/modules/emacs/dired/config.el b/modules/emacs/dired/config.el index ee76ffa66..eb5eb76fb 100644 --- a/modules/emacs/dired/config.el +++ b/modules/emacs/dired/config.el @@ -19,7 +19,7 @@ :config (setq dired-listing-switches "-aBhl --group-directories-first") - (when IS-MAC + (when IS-BSD ;; Use GNU ls as `gls' from `coreutils' if available. Add `(setq ;; dired-use-ls-dired nil)' to your config to suppress the Dired warning ;; when not using GNU ls. We must look for `gls' after @@ -27,7 +27,7 @@ ;; `exec-path' (if-let* ((gls (executable-find "gls"))) (setq insert-directory-program gls) - (message "Cannot find `gls`. Install it using `brew install coreutils`"))) + (message "Cannot find `gls` (GNU ls). Install coreutils via your system package manager"))) (defun +dired|sort-directories-first () "List directories first in dired buffers."