The backtrace you give in the question actually has all the information you need to debug this so while the answer is in the comments I'll go through the logic.
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
call-process(nil nil nil nil "--dired")
So an argument here has failed the stringp predicate check. This first place to look is at C-h f call-process:
call-process is a built-in function in ‘C source code’.
(call-process PROGRAM &optional INFILE DESTINATION DISPLAY &rest ARGS)
Call PROGRAM synchronously in separate process.
Well that's a bit of a pain, it is in the C code. If you have a copy of the code checked out you could have looked and found the following in src/callproc.c:
if (nargs >= 2 && ! NILP (args[1]))
{
infile = Fexpand_file_name (args[1], BVAR (current_buffer, directory));
CHECK_STRING (infile);
}
But as most people don't have the C code on their systems we'll look higher up the stack. From the help text though it seems pretty likely calling call-process with nil for its only mandatory argument isn't going to end well. So up the stack:
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
call-process(nil nil nil nil "--dired")
dired-insert-directory("/home/hb/test/" "-al" nil nil t)
So we visit C-h f dired-insert-directory and follow the link to dired.el to look at the code. M-x narrow-to-defun and we can search just in this function for the call-process invocation:
(if (and
;; Don't try to invoke `ls' if we are on DOS/Windows where
;; ls-lisp emulation is used, except if they want to use `ls'
;; as indicated by `ls-lisp-use-insert-directory-program'.
(not (and (featurep 'ls-lisp)
(null ls-lisp-use-insert-directory-program)))
(or (if (eq dired-use-ls-dired 'unspecified)
;; Check whether "ls --dired" gives exit code 0, and
;; save the answer in `dired-use-ls-dired'.
(or (setq dired-use-ls-dired
(eq 0 (call-process insert-directory-program
nil nil nil "--dired")))
(progn
(message "ls does not support --dired; see `dired-use-ls-dired' for more details.")
nil))
dired-use-ls-dired)
(file-remote-p dir)))
(setq switches (concat "--dired " switches)))
And we see the invocation:
(call-process insert-directory-program nil nil nil "--dired")
A quick C-h v insert-directory-program:
insert-directory-program is a variable defined in ‘files.el’.
Its value is "ls"
This variable may be risky if used as a file-local variable.
Documentation:
Absolute or relative name of the ‘ls’ program used by ‘insert-directory’.
And if we follow the link to the definition:
(defvar insert-directory-program (purecopy "ls")
"Absolute or relative name of the `ls' program used by `insert-directory'.")
So we can see it defaults to "ls", ergo if it is not set something has messed with the setting. You can verify this by running emacs -Q to confirm the default setup works.
insert-directory-program
? – npostavs Aug 12 '16 at 13:23M-x dired
? What are the values of variablesls-lisp-use-insert-directory-program
anddired-use-ls-dired
? (The backtrace and the fact that the 3rd arg tocall-process
isnil
suggests that this is happening directly indired-insert-directory
and not ininsert-directory
.) And what happens if you start Emacs usingemacs -Q
(no init file) - same problem? – Drew Aug 12 '16 at 15:31insert-directory-program
tonil
, the default value is"ls"
. – npostavs Aug 15 '16 at 3:00inser-directory-program
was set to gls (GNU ls) which I didn't have on my machine. Commenting the part out solved the problem. Do you care to post it as an answer so that I can accept? Ty!! :) – stats-hb Aug 15 '16 at 10:42