Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wrong type argument: stringp, nil error

Tags:

emacs

elisp

I need to use update-directory-autoloads function in a little el-script. When I'm trying to call this function with an argument that is a name of a directory I receive this error:

Wrong type argument: stringp, nil.

Call looks like this: (update-directory-autoloads "~/test")

like image 912
Jaŭhien Piatlicki Avatar asked Feb 07 '13 22:02

Jaŭhien Piatlicki


2 Answers

When you get Wrong type argument: foo, bar., you should M-: (setq debug-on-error t) RET and then reproduce the error so as to get a backtrace. Actually, you can set debug-on-error like that in your .emacs and Emacs usually stays perfectly useable.

like image 174
Stefan Avatar answered Nov 11 '22 08:11

Stefan


Generating autoload files is poorly documented. You're experiencing the problem that arises because you haven't set the variable generated-autoload-file. Try the following:

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

Update the generated-autoloads-file binding to be the location where you want the loaddefs.el file to live.

like image 45
Trey Jackson Avatar answered Nov 11 '22 08:11

Trey Jackson