Problem emulating load with eval
It seems commit 81f5f4da26b2b9e8c4ce9cc0272c3fb7ea4dbf3e changed esup-child.el to use advice on the load function. The advised function then steps through the code one sexp at at time doing an eval. This causes problems with the files automatically generated by package-install, which all contain lines such as:
(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
The #$ construct is handled by load, but generates an error with eval.
On a related note, since my esup only works when esup-child-max-depth is 0, how does one set this variable?
Having the same problem here. More specifically, it always fails with the following error:
ERROR(profile-sexp) at /home/colinxy/.emacs.d/elpa/yasnippet-20180412.1548/yasnippet-autoloads.el:4 with sexp (add-to-list (quote load-path) (directory-file-name (or (file-name-directory nil) (car load-path)))): error=(wrong-type-argument stringp nil)
Results will be incomplete due to errors.
Oh, I didn't realize load had special variables.
I added the customize variable esup-depth for controlling the depth. So, set esup-depth via customize or setq and it will get passed to esup-child.
There's a couple ways to handle this:
- Don't intercept any
loadcalls. That feels like throwing the baby out with the bathwater. - Don't intercept files that end in
-autoloads.el. - Use a customized read-function that sets
#$to the current file name.
Just dynamically bind load-file-name to the appropriate value. That will cause read to expand #$ correctly. I had to do this for straight.el to correctly read autoloads files that used #$, for example.
Getting exactly this same error just by initializing package.el:
ERROR(profile-sexp) at /nix/store/xklyvs4b31dl37pyfyjbvri69wckgmmr-emacs-packages-deps/share/emacs/site-lisp/elpa/memoize-20180614.1230/memoize-autoloads.el:5 with sexp (add-to-list (quote load-path) (directory-file-name (or (file-name-directory nil) (car load-path)))): error=(wrong-type-argument stringp nil)
Would be nice is a fix was made so esup can be used with package.el at all :smile:
Please fix it! This bug makes esup completely incompatible with package.el!
A crappy workaround this bug:
- write a shell skript
/tmp/sed.sh:
#/bin/bash
FILE="$PWD/$1"
sed -i.bak -e "s|^\(.*\)#\$\(.*\)$|;;\1#$\2\n\1\"$FILE\"\2|" "$1"
- then
cdto the~/.emacs/elpadirectory - then call this script with
find:
find . -iname "*-autoloads.el" -exec /tmp/sed.sh {} \;
Ping, is there workaround for this that I can set in init.el?
Any luck with this?