wrong type argument: stringp, nil

You’ll need to provide more information to be sure. Try setting (setq debug-on-error t) which will give you a stack trace showing what function is complaining about the string being nil. My guess is that buffer-file-name is returning nil, and that’s where the problem lies (not all buffers have file names). Check out the debugging … Read more

How to determine whether a package is installed in elisp?

tripleee’s answer is a handy example of error handling, but unnecessary in this instance. (when (require ‘some-library nil ‘noerror) do-things) That ‘noerror can be any non-nil value, but of course it’s more descriptive this way. I often see :noerror used as well, but I’ve no idea if there’s any particular advantage to using a keyword … Read more

tech