Ever since upgrading to emacs 24.x
I've been seeing this error whenever I open a directory. The entire error is:
ls does not support --dired; see `dired-use-ls-dired' for more details.
Looking at the variable, one finds:
dired-use-ls-dired is a variable defined in `dired.el'.
Its value is nil
Original value was unspecified
Documentation:
Non-nil means Dired should pass the "--dired" option to "ls".
The special value of `unspecified' means to check explicitly, and
save the result in this variable. This is performed the first
time `dired-insert-directory' is called.
Note that if you set this option to nil, either through choice or
because your "ls" program does not support "--dired", Dired
will fail to parse some "unusual" file names, e.g. those with leading
spaces. You might want to install ls from GNU Coreutils, which does
support this option. Alternatively, you might want to use Emacs's
own emulation of "ls", by using:
(setq ls-lisp-use-insert-directory-program nil)
(require 'ls-lisp)
This is used by default on MS Windows, which does not have an "ls" program.
Note that `ls-lisp' does not support as many options as GNU ls, though.
For more details, see Info node `(emacs)ls in Lisp'.
You can customize this variable.
I'm running on FreeBSD; so the default ls
is not GNU'ish and doesn't offer the --dired
option. I don't really feel like going to the trouble to install GNU coreutilities on all of my servers.
Anyone have any experience with the lisp ls
alternative mentioned above?
Presumably dired.el
is setting dired-use-ls-dired
to something non-nil when loaded and I'm constantly clobbering it the first time I view a directory? And setting dired-use-ls-dired
to nil in my .emacs
would quiet the message?
Does anyone have the opinion that not getting dired to work might represent a security issue? i.e. would filenames composed of whitespace remain invisible?
Maybe I should test some of the above...
ls-lisp
if yourls
doesn't support --dired;ls-lisp
doesn't have all the features of GNUls
, but you don't need them for dired. And emacs handles whitespace correctly in filenames; it'sls
that doesn't indicate which whitespace is or isn't part of the file name ... but you don't have to use ls ... just usels-lisp
instead. (emacs runs on some systems that don't have anyls
command. It does not "rely" on it.) – Idioplasm