prelude-editor.el: fails to load on Emacs 30
vincentkam opened this issue · 2 comments
Expected behavior
Emacs starts up with prelude.
Actual behavior
Emacs fails to startup with prelude, yielding this error:
Debugger entered--Lisp error: (wrong-type-argument obarrayp [nil nil nil nil nil nil nil nil nil nil nil nil nil])
intern("diff-hl-revert-hunk" [nil nil nil nil nil nil nil nil nil nil nil nil nil])
#f(compiled-function (x) #<bytecode 0x595f1279>)(("n" . diff-hl-revert-hunk))
mapc(#f(compiled-function (x) #<bytecode 0x595f1279>) (("n" . diff-hl-revert-hunk) ("[" . diff-hl-previous-hunk) ("]" . diff-hl-next-hunk) ("S" . diff-hl-stage-dwim)))
smartrep-define-key((keymap (24 keymap (118 . diff-hl-command-map)) (remap keymap (vc-diff . diff-hl-diff-goto-hunk))) "\30v" (("n" . diff-hl-revert-hunk) ("[" . diff-hl-previous-hunk) ("]" . diff-hl-next-hunk) ("S" . diff-hl-stage-dwim)))
byte-code("\303\304\305\306#\203!\0\305C\305C\211\307\310\3\5#\240\210\211\242\10!\210\311\11\n\4\242#\266\3\312\313\10\"\207" [diff-hl-command-map diff-hl-mode-map diff-hl-command-prefix require smartrep nil t make-closure #f(compiled-function (map) #<bytecode -0xa42eb8d3cd8f73a>) smartrep-define-key map-keymap #f(compiled-function (key cmd) #<bytecode -0x8eb203ccfe357cf>)] 7)
global-diff-hl-mode(1)
byte-code("\306\307!\210\310\20\311\21\312\22\306\313!\210\314\315\316\"\210\317\311!\210\306\320!\210\321\13BC\24\311\25\322 \210\323\324!\210\325\326!\210\327\326!\210\314\330\331\"\210\314\332\333\"\210\334\335\336\"\210\334\337\340\"\210\306\341!\210\306\342!\210\343\16/\344\345#\210\346\347\350\351\310$\210\352\347\310\"\210\306\353!\210\354\326!\210\323\354!\210\355\356!\207" [compilation-ask-about-save compilation-always-kill compilation-scroll-output temporary-file-directory undo-tree-history-directory-alist undo-tree-auto-save-history require compile nil t first-error ansi-color add-hook compilation-filter-hook prelude-colorize-compilation-buffer prelude-mode undo-tree ".*" global-undo-tree-mode diminish undo-tree-mode winner-mode 1 global-diff-hl-mode dired-mode-hook diff-hl-dired-mode magit-post-refresh-hook diff-hl-magit-post-refresh global-set-key [remap kill-ring-save] easy-kill [remap mark-sexp] easy-mark operate-on-number smartrep smartrep-define-key "C-c ." (("+" . apply-operation-to-number-at-point) ("-" . apply-operation-to-number-at-point) ("*" . apply-operation-to-number-at-point) ("/" . apply-operation-to-number-at-point) ("\\" . apply-operation-to-number-at-point) ("^" . apply-operation-to-number-at-point) ("<" . apply-operation-to-number-at-point) (">" . apply-operation-to-number-at-point) ("#" . apply-operation-to-number-at-point) ("%" . apply-operation-to-number-at-point) ("'" . operate-on-number-at-point)) ad-add-advice server-visit-files (parse-numbers-in-lines nil t (advice lambda (files proc &optional nowait) "Open file with emacsclient with cursors positioned on requested line.\nMost of console-based utilities prints filename in format\n'filename:linenumber'. So you may wish to open filename in that format.\nJust call:\n\n emacsclient filename:linenumber\n\nand file 'filename' will be opened and cursor set on line 'linenumber'" (ad-set-arg 0 (mapcar (lambda (fn) (let ... ...)) files)))) before ad-activate editorconfig editorconfig-mode provide prelude-editor global-map] 5)
require(prelude-editor)
load-with-code-conversion("/Users/vincent/.emacs.d/init.el" "/Users/vincent/.emacs.d/init.el" t t)
load("/Users/vincent/.emacs.d/init" noerror nomessage)
#f(compiled-function () #<bytecode 0x12e01539f8f77791>)()
#f(compiled-function () #<bytecode -0x4307d7bb01d2857>)()
handler-bind-1(#f(compiled-function () #<bytecode -0x4307d7bb01d2857>) (error) startup--debug)
startup--load-user-init-file(#f(compiled-function () #<bytecode 0x427c958d1b6c193>) #f(compiled-function () #<bytecode 0x731968ef940459b>) t)
command-line()
normal-top-level()
If I go into prelude-core.el
and comment out this line: https://github.com/bbatsov/prelude/blame/master/core/prelude-editor.el#L374C2-L374C25, then we get the following error:
Debugger entered--Lisp error: (wrong-type-argument obarrayp [nil nil nil nil nil nil nil nil nil nil nil nil nil])
intern("apply-operation-to-number-at-point" [nil nil nil nil nil nil nil nil nil nil nil nil nil])
#f(compiled-function (x) #<bytecode 0x57454eff>)(("+" . apply-operation-to-number-at-point))
mapc(#f(compiled-function (x) #<bytecode 0x57454eff>) (("+" . apply-operation-to-number-at-point) ("-" . apply-operation-to-number-at-point) ("*" . apply-operation-to-number-at-point) ("/" . apply-operation-to-number-at-point) ("\\" . apply-operation-to-number-at-point) ("^" . apply-operation-to-number-at-point) ("<" . apply-operation-to-number-at-point) (">" . apply-operation-to-number-at-point) ("#" . apply-operation-to-number-at-point) ("%" . apply-operation-to-number-at-point) ("'" . operate-on-number-at-point)))
smartrep-define-key((keymap #^[nil nil keymap #^^[3 0 set-mark-command move-beginning-of-line backward-char mode-specific-command-prefix delete-char move-end-of-line forward-char keyboard-quit help-command indent-for-tab-command electric-newline-and-maybe-indent kill-line recenter-top-bottom newline next-line open-line previous-line quoted-insert isearch-backward isearch-forward transpose-chars universal-argument scroll-up-command kill-region Control-X-prefix yank suspend-frame ESC-prefix toggle-input-method abort-recursive-edit nil ...] #^^[1 0 #^^[2 0 #^^[3 0 set-mark-command move-beginning-of-line backward-char mode-specific-command-prefix delete-char move-end-of-line forward-char keyboard-quit help-command indent-for-tab-command electric-newline-and-maybe-indent kill-line recenter-top-bottom newline next-line open-line previous-line quoted-insert isearch-backward isearch-forward transpose-chars universal-argument scroll-up-command kill-region Control-X-prefix yank suspend-frame ESC-prefix toggle-input-method abort-recursive-edit nil ...] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command ...] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command ...] (remap keymap (mark-sexp . easy-mark) (kill-ring-save . easy-kill)) (S-mouse-3 . kmacro-end-call-mouse) (C-wheel-up . mouse-wheel-text-scale) (C-wheel-down . mouse-wheel-text-scale) (C-mouse-5 . mouse-wheel-text-scale) (C-mouse-4 . mouse-wheel-text-scale) (C-M-wheel-up . mouse-wheel-global-text-scale) (C-M-wheel-down . mouse-wheel-global-text-scale) (C-M-mouse-5 . mouse-wheel-global-text-scale) (C-M-mouse-4 . mouse-wheel-global-text-scale) (M-wheel-right . mwheel-scroll) (M-wheel-left . mwheel-scroll) (M-wheel-up . mwheel-scroll) (M-wheel-down . mwheel-scroll) (M-mouse-7 . mwheel-scroll) (M-mouse-6 . mwheel-scroll) (M-mouse-5 . mwheel-scroll) (M-mouse-4 . mwheel-scroll) (S-wheel-right . mwheel-scroll) (S-wheel-left . mwheel-scroll) (S-wheel-up . mwheel-scroll) (S-wheel-down . mwheel-scroll) (S-mouse-7 . mwheel-scroll) (S-mouse-6 . mwheel-scroll) (S-mouse-5 . mwheel-scroll) (S-mouse-4 . mwheel-scroll) (wheel-right . mwheel-scroll) (wheel-left . mwheel-scroll) (wheel-up . mwheel-scroll) (wheel-down . mwheel-scroll) ...) "C-c ." (("+" . apply-operation-to-number-at-point) ("-" . apply-operation-to-number-at-point) ("*" . apply-operation-to-number-at-point) ("/" . apply-operation-to-number-at-point) ("\\" . apply-operation-to-number-at-point) ("^" . apply-operation-to-number-at-point) ("<" . apply-operation-to-number-at-point) (">" . apply-operation-to-number-at-point) ("#" . apply-operation-to-number-at-point) ("%" . apply-operation-to-number-at-point) ("'" . operate-on-number-at-point)))
load-with-code-conversion("/Users/vincent/.emacs.d/core/prelude-editor.el" "/Users/vincent/.emacs.d/core/prelude-editor.el" nil t)
require(prelude-editor)
load-with-code-conversion("/Users/vincent/.emacs.d/init.el" "/Users/vincent/.emacs.d/init.el" t t)
load("/Users/vincent/.emacs.d/init" noerror nomessage)
#f(compiled-function () #<bytecode 0x12e01539f8f77791>)()
#f(compiled-function () #<bytecode -0x4307d7bb01d2857>)()
handler-bind-1(#f(compiled-function () #<bytecode -0x4307d7bb01d2857>) (error) startup--debug)
startup--load-user-init-file(#f(compiled-function () #<bytecode 0x427c958d1b6c193>) #f(compiled-function () #<bytecode 0x731968ef940459b>) t)
command-line()
normal-top-level()
If I then comment out the following lines:
https://github.com/bbatsov/prelude/blame/master/core/prelude-editor.el#L386-L398
Then emacs can startup without any errors.
Steps to reproduce the problem
- Install Emacs 30. I used
brew install emacs-plus@30 --with-native-comp --with-poll --with-imagemagick
- Install Prelude.
- Try to start Emacs.
Environment & Version information
Emacs version
GNU Emacs 30.0.50 (build 1, aarch64-apple-darwin23.4.0, NS appkit-2487.50 Version 14.4 (Build 23E214)) of 2024-04-16
Operating system
MacOS 14.4
Found this: dgutov/diff-hl#217. This seems to be a bug with smartrep
, which hasn't been updated in a number of years. There is a fork that fixes the issue. https://github.com/rgiar/smartrep.el
Fixed upstream!