Add IS-BSD constant

Fixes dired gls support on BSD OSes (and not just MacOS).
This commit is contained in:
Henrik Lissner 2019-01-05 16:04:38 -05:00
parent 232cb190cc
commit 19987df00a
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 3 additions and 2 deletions

View file

@ -22,6 +22,7 @@ line or use --debug-init to enable this.")
(defconst IS-MAC (eq system-type 'darwin)) (defconst IS-MAC (eq system-type 'darwin))
(defconst IS-LINUX (eq system-type 'gnu/linux)) (defconst IS-LINUX (eq system-type 'gnu/linux))
(defconst IS-WINDOWS (memq system-type '(cygwin windows-nt ms-dos))) (defconst IS-WINDOWS (memq system-type '(cygwin windows-nt ms-dos)))
(defconst IS-BSD (or IS-MAC (eq system-type 'berkeley-unix)))
;; ;;

View file

@ -19,7 +19,7 @@
:config :config
(setq dired-listing-switches "-aBhl --group-directories-first") (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 ;; Use GNU ls as `gls' from `coreutils' if available. Add `(setq
;; dired-use-ls-dired nil)' to your config to suppress the Dired warning ;; dired-use-ls-dired nil)' to your config to suppress the Dired warning
;; when not using GNU ls. We must look for `gls' after ;; when not using GNU ls. We must look for `gls' after
@ -27,7 +27,7 @@
;; `exec-path' ;; `exec-path'
(if-let* ((gls (executable-find "gls"))) (if-let* ((gls (executable-find "gls")))
(setq insert-directory-program 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 () (defun +dired|sort-directories-first ()
"List directories first in dired buffers." "List directories first in dired buffers."