I just installed Emacs 24.4 from source (on Ubuntu 14.04). I now get the following error when running Emacs:
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
string-match("/[._]emacs\\.d/?\\'" nil nil)
command-line()
normal-top-level()
For debugging, I reduced my ~/.emacs
init file to:
(setq debug-on-error t)
(add-to-list 'load-path nil)
Then the error occurs only when starting Emacs with two arguments, where the first argument is an option, for example --no-splash
, and the second argument is a file name with a suffix, for example a.txt
. Some other observations:
- If I remove the option (
--no-splash
) it works fine, - if I remove the line
(add-to-list 'load-path nil)
it works fine, - if I run with Emacs v. 24.3 it works fine,
- if I change
nil
to"."
, in~/.emacs
it works fine, - if I remove the suffix from the file name, that is: changing
a.txt
toa
, I get another error:Args out of range: 0
.
Edit After adding nil
to load-path
, the variable looks like:
(nil "/opt/emacs24.4/share/emacs/24.4/site-lisp" "/opt/emacs24.4/share/emacs/site-lisp" "/opt/emacs24.4/share/emacs/24.4/lisp" "/opt/emacs24.4/share/emacs/24.4/lisp/vc" "/opt/emacs24.4/share/emacs/24.4/lisp/url" "/opt/emacs24.4/share/emacs/24.4/lisp/textmodes" "/opt/emacs24.4/share/emacs/24.4/lisp/progmodes" "/opt/emacs24.4/share/emacs/24.4/lisp/play" "/opt/emacs24.4/share/emacs/24.4/lisp/org" "/opt/emacs24.4/share/emacs/24.4/lisp/nxml" "/opt/emacs24.4/share/emacs/24.4/lisp/net" "/opt/emacs24.4/share/emacs/24.4/lisp/mh-e" "/opt/emacs24.4/share/emacs/24.4/lisp/mail" "/opt/emacs24.4/share/emacs/24.4/lisp/leim" "/opt/emacs24.4/share/emacs/24.4/lisp/language" "/opt/emacs24.4/share/emacs/24.4/lisp/international" "/opt/emacs24.4/share/emacs/24.4/lisp/gnus" "/opt/emacs24.4/share/emacs/24.4/lisp/eshell" "/opt/emacs24.4/share/emacs/24.4/lisp/erc" "/opt/emacs24.4/share/emacs/24.4/lisp/emulation" "/opt/emacs24.4/share/emacs/24.4/lisp/emacs-lisp" "/opt/emacs24.4/share/emacs/24.4/lisp/cedet" "/opt/emacs24.4/share/emacs/24.4/lisp/calendar" "/opt/emacs24.4/share/emacs/24.4/lisp/calc" "/opt/emacs24.4/share/emacs/24.4/lisp/obsolete")
According to the Emacs manual:
Variable: load-path
The value of this variable is a list of directories to search when loading files with load. Each element is a string (which must be a directory name) or nil (which stands for the current working directory).
commandline arguments
, but could not find any such tags.. Maybe it should be added by someone?init
since this is about what happens before Emacs initialization is done.M-x report-emacs-bug
nil
to yourload-path
? Unless I am mistaken, the purpose of usingadd-to-list
is to add something to a list, instead of nothing. And if Emacs looks to that list to decide which files to load and it encounters anil
value, wouldn't one naturally expect to see an error? How could anil
value inside aload-path
list be useful?