Search for GNU ls after exec-path was setup

We need to look for GNU ls after exec-path-from-shell was initialised
and has fixed exec-path.  Otherwise the directory containing gls may not
yet be in exec-path
This commit is contained in:
Sebastian Wiesner 2015-10-11 10:59:16 +02:00 committed by syl20bnr
parent e5dbfa0032
commit f89ec043fd

View file

@ -1,5 +1,6 @@
(setq osx-packages (setq osx-packages
'( '(
exec-path-from-shell
osx-trash osx-trash
pbcopy pbcopy
launchctl launchctl
@ -10,16 +11,18 @@
;; Enable built-in trash support via finder API if available (only on Emacs ;; Enable built-in trash support via finder API if available (only on Emacs
;; Mac Port) ;; Mac Port)
(when (boundp 'mac-system-move-file-to-trash-use-finder) (when (boundp 'mac-system-move-file-to-trash-use-finder)
(setq mac-system-move-file-to-trash-use-finder t)) (setq mac-system-move-file-to-trash-use-finder t)))
;; Use `gls' if `coreutils' was installed prefixed ('g') otherwise, leave
;; alone. Manually add to config `(setq dired-use-ls-dired nil)' to surpesss (defun osx/post-init-exec-path-from-shell ()
;; warnings, when not using `coreutils' version of 'ls' on OS X. ;; Use GNU ls as `gls' from `coreutils' if available. Add `(setq
;; See brew info coreutils ;; dired-use-ls-dired nil)' to your config to suppress the Dired warning when
(when (executable-find "gls") ;; not using GNU ls. We must look for `gls' after `exec-path-from-shell' was
;; maybe absolute or relative name of the `ls' program used by ;; initialized to make sure that `gls' is in `exec-path'
;; `insert-directory'. (when (spacemacs/system-is-mac)
(setq insert-directory-program "gls" (let ((gls (executable-find "gls")))
dired-listing-switches "-aBhl --group-directories-first"))) (when gls
(setq insert-directory-program gls
dired-listing-switches "-aBhl --group-directories-first")))))
(defun osx/init-osx-trash () (defun osx/init-osx-trash ()
(use-package osx-trash (use-package osx-trash