prelude
prelude copied to clipboard
Starting Emacs - prelude-web errors out (and prevents personal/init.el from loading)
I am using emacs-plus@29 (https://github.com/d12frosted/homebrew-emacs-plus) on MacOS with native-compilation, but I have also seen this issue with emacs-plus@28 (also with native-compilation).
This is what I see when running emacs --debug-init
Debugger entered--Lisp error: (error "Keyword argument (sp-in-string-p) not one of (:tri...")
error("Keyword argument %s not one of (:trigger :trigger-..." (sp-in-string-p))
sp-local-pair("%" "%" :unless (sp-in-string-p) :post-handlers (((lambda (&rest _ignored) (just-one-space) (save-excursion (insert " "))) "SPC" "=" "#")))
byte-code("\301\302!\210\303\304!\210\305\306\307\"\210\305\306\310\"\210\305\306\311\"\210\305\306\312\"\210\305\306\313\"\210\305\306\314\"\210\305\306\315\"\210\305\306\316\"\210\305\306..." [web-mode-enable-auto-pairing prelude-require-packages (web-mode) require web-mode add-to-list auto-mode-alist ("\\.phtml\\'" . web-mode) ("\\.tpl\\.php\\'" . web-mode) ("\\.tpl\\'" . web-mode) ("\\.hbs\\'" . web-mode) ("\\.blade\\.php\\'" . web-mode) ("\\.jsp\\'" . web-mode) ("\\.as[cp]x\\'" . web-mode) ("\\.erb\\'" . web-mode) ("\\.html?\\'" . web-mode) ("/\\(views\\|html\\|theme\\|templates\\)/.*\\.php\\'" . web-mode) nil sp-with-modes (web-mode) sp-local-pair "%" :unless (sp-in-string-p) :post-handlers (((lambda (&rest _ignored) (just-one-space) (save-excursion (insert " "))) "SPC" "=" "#")) sp-local-tag "<% " " %>" "=" "<%= " "#" "<%# " eval-after-load #f(compiled-function () #<bytecode 0x170a0f2c0c1e810d>) provide prelude-web] 9)
require(prelude-web)
load-with-code-conversion("/Users/vhk/.emacs.d/personal/prelude-modules.el" "/Users/vhk/.emacs.d/personal/prelude-modules.el" nil nil)
load("/Users/vhk/.emacs.d/personal/prelude-modules.el")
byte-code("\306\307\10\"\210\306\307\11\"\210\306\307\n\"\210\310\n!\210\311\23\312\24\313\15!\203+\0\314\315\15\"\210\316\317\320\15\321\322#\"\210\314\323!\210\324\325!..." [prelude-core-dir prelude-modules-dir prelude-vendor-dir gc-cons-threshold large-file-warning-threshold prelude-personal-preload-dir add-to-list load-path prelude-add-subfolders-to-load-path 50000000 100000000 file-exists-p message "[Prelude] Loading personal configuration files in ..." mapc load directory-files t "^[^#.].*el$" "[Prelude] Loading Prelude's core modules..." require prelude-packages prelude-custom prelude-ui prelude-core prelude-mode prelude-editor prelude-global-keybindings darwin prelude-macos gnu/linux prelude-linux getenv "WSLENV" prelude-wsl windows-nt prelude-windows "[Prelude] Loading Prelude's additional modules..." "[Prelude] Missing personal modules file %s" "[Prelude] Falling back to the bundled example file..." "[Prelude] You should copy this file to your person..." expand-file-name "sample/prelude-modules.el" "custom.el" delete "^[^#.].*\\.el$" "[Prelude] Prelude is ready to do thy bidding, Mast..." version< "25.3" eval-after-load ...] 8)
load("/Users/vhk/.emacs.d/init" noerror nomessage)
startup--load-user-init-file(#f(compiled-function () #<bytecode 0x15532e3f22bec5>) #f(compiled-function () #<bytecode -0x1f3c6feddc0c3735>) t)
command-line()
normal-top-level()
After hitting this error, it appears that my personal/init.el does not load, as evidenced by my custom keybindings not working e.g.
(global-set-key (kbd "C-x C-b") 'helm-mini)
I have tried updating all my packages via package-list-packages, U, x as well as running prelude-update-packages and prelude-update, but the error persists.
Workarounds:
- Disable
prelude-webinprelude-modules.el. - Uninstall emacs-plus@29, then reinstall it. Oddly enough, on the FIRST run of emacs-plus@29 after installation, I don't seem to see this error. I've only done this twice. This may simply be an artifact of the eln files being regenerated when there's a new version though (see below).
- Delete the
elnfile forprelude-webunder.emacs.d/eln-cache: this only worked for me sometimes. - Delete ALL the eln files in the
eln-cache. I've only tried this once. I've attached a subset of the warnings that appear after deleting the eln files and starting emacs: there appear to be someprelude-webrelated ones. warnings.txt
I see the actually error seems to be in smartparens, which might not be required in some circumstaces by prelude-web. Can you comment out the sp init logic there and see if this works properly?
Hey @bbatsov ,
Sorry, just to make sure I'm following along: are you suggesting that the following lines be commented out as a test? https://github.com/bbatsov/prelude/blob/416ffd3bbfefd551c72017234d3d1be9283fc180/modules/prelude-web.el#L52-L61
@vincentkam Yep.
I commented out the suggested lines: the error ((error "Keyword argument (sp-in-string-p) not one of (:tri...") error("Keyword argument %s not one of (:trigger :trigger-..." (sp-in-string-p))) went away and my personal/init.el loads now, as evidenced by my custom keybindings working. Thanks!
Regardless of whether or not I commented out those lines though, I noticed that the following warnings are also emitted on startup though:
⛔ Warning (comp): /Users/vhk/.emacs.d/modules/prelude-js.el: Error: Symbol's function definition is void sp-pair
⛔ Warning (comp): /Users/vhk/.emacs.d/modules/prelude-perl.el: Error: Symbol's function definition is void sp-pair
⛔ Warning (comp): /Users/vhk/.emacs.d/modules/prelude-ts.el: Error: Symbol's function definition is void sp-pair
⛔ Warning (comp): /Users/vhk/.emacs.d/modules/prelude-c.el: Error: Symbol's function definition is void sp-pair
⛔ Warning (comp): /Users/vhk/.emacs.d/modules/prelude-lisp.el: Error: Symbol's function definition is void sp-pair
⛔ Warning (comp): /Users/vhk/.emacs.d/modules/prelude-emacs-lisp.el: Error: Symbol's function definition is void sp-pair
This issue randomly came up for me. It hasn't happened before, and was initially confused when looking at the date of the last comment here. I looked at the failing code in prelude-web though It seems as if the sp-with-modes macro didn't expand correctly but the bad code generated ended up in the .elc file? I don't know since it is not showing up again after tinkering ... it would have just recompiled the .elc file and it came out fine. Regardless, this helped me drill down to the issue :)
I revisited this and tried un-commenting the previously commented-out lines in https://github.com/bbatsov/prelude/issues/1385#issuecomment-1314184407 , using Emacs 30 with native compilation and the latest prelude, and it seems to be okay for me now! Perhaps @bolsen is correct and that simply tinkering with the file resulted in the .elc files recompiling? In any case, I'll close this for now! :)
I've seen this issue randomly come back and the solution seems to be to force recompilation of the prelude-web file, although the smartparens package in MELPA appears to be bugged atm (https://github.com/Fuco1/smartparens/issues/1204), so unsure if this is playing into it.
Also, when prelude-web does load, I see the following warning:
⛔ Warning (comp): ~/.emacs.d/modules/prelude-web.el:33:2: Warning: the function ‘prelude-require-packages’ is not known to be defined.
The work around mentioned by @vincentkam is to delete the prelude-web.elc file from ~/.emacs.d/modules (that will let emacs start with no error) ~~then you can recompile with m-x byte-compile-file~~. Recompiling it seems to then cause warnings which I don't get if I don't recompile it