Invalid type argument: stringp, nil error

I need to use the update-directory-autoloads in a small el script. When I try to call this function with an argument which is the directory name, I get this error:

Wrong type argument: stringp, nil.

The call is as follows: (update-directory-autoloads "~/test")

+7
source share
2 answers

Startup file generation is poorly documented. A problem arises because you did not set the generated-autoload-file variable. Try the following:

 (let ((generated-autoload-file "~/test/loaddefs.el")) (update-directory-autoloads "~/test")) 

Update the generated-autoloads-file binding to be the place where you want loaddefs.el work.

+6
source

When you get the Wrong type argument: foo, bar. , you have to M-: (setq debug-on-error t) RET , and then reproduce the error to get the backtrace. In fact, you can set debug-on-error like this in your .emacs, and Emacs usually remains completely useful.

+9
source

All Articles