Closed twlz0ne closed 3 years ago
⋊> emacs -nw -Q --eval " (progn (toggle-debug-on-error) (setq user-emacs-directory \"~/.emacs.d/\") (setq package-user-dir (expand-file-name \"elpa/\" user-emacs-directory)) (package-initialize)) " --batch
That prints "Debug on Error enabled globally" and exits with 0.
That prints "Debug on Error enabled globally" and exits with 0.
It's strange.
The error on my computer is caused by the following code in subed-autoloads.el
:
(dolist (item subed--init-alist) (let ((file-ext-regex (car item))) (add-to-list 'auto-mode-alist (cons (concat "\\." file-ext-regex "\\'") 'subed-mode))))
When I moved the definition of subed--init-alist
from subed-config.el
to subed.el
, then remake autoloads, the error dispear:
- (defvar subed--init-alist '(("srt" . subed-srt--init)
- ("vtt" . subed-vtt--init))
- "Alist that maps file extensions to format-specific init functions.")
+ ;;;###autoload
+ (defvar subed--init-alist '(("srt" . subed-srt--init)
+ ("vtt" . subed-vtt--init))
+ "Alist that maps file extensions to format-specific init functions.")
...
;;;###autoload
(dolist (item subed--init-alist)
(let ((file-ext-regex (car item)))
(add-to-list 'auto-mode-alist (cons (concat "\\." file-ext-regex "\\'")
'subed-mode))))
+ (defvar subed--init-alist '(("srt" . subed-srt--init) ("vtt" . subed-vtt--init)) "\
+ Alist that maps file extensions to format-specific init functions.")
...
(dolist (item subed--init-alist) (let ((file-ext-regex (car item))) (add-to-list 'auto-mode-alist (cons (concat "\\." file-ext-regex "\\'") 'subed-mode))))
Where did you get subed-autoloads.el
?
It's not part of the repo.
Where did you get
subed-autoloads.el
? It's not part of the repo.
Now I understand why there is no error occurs on your computer, because you used the source code directly, that makes autoload
not take effect.
I installed subed via quelpa:
(quelpa '(subed :fetcher github "rndusr/subed" :files "subed/*.el"))
It compiles the source into an ELPA compatible package, the subed-autoloads.el
is thus created.
The little change I made above will ensure that the definition of subed--init-alist
will also be added to subed-autoloads.el
before the dolist
statement: https://github.com/twlz0ne/subed/commit/73ad0a5497bfef64a2a9e8e8a9a49285ab9bd7e5
Same problem here, I'm using borg to install this package which will also generate an autoload file when building.
twlz0ne's patch resolves this issue.
I made a little change to ensure that the definition of
subed--init-alist
will also be added tosubed-autoloads.el
before thedolist
statement: https://github.com/twlz0ne/subed/commit/73ad0a5497bfef64a2a9e8e8a9a49285ab9bd7e5
Thank you.
Expected Behavior
No error occurs at startup.
Actual Behavior
void-variable subed--init-alist
occurs at startup.Extra details
Debugger entered--Lisp error: (void-variable subed--init-alist)
``` Debug on Error enabled globally Package cl is deprecated Debugger entered--Lisp error: (void-variable subed--init-alist) (let ((--dolist-tail-- subed--init-alist)) (while --dolist-tail-- (let ((item (car --dolist-tail--))) (let ((file-ext-regex (car item))) (add-to-list 'auto-mode-alist (cons (concat "\\." file-ext-regex "\\'") 'subed-mode))) (setq --dolist-tail-- (cdr --dolist-tail--))))) eval-buffer(#Steps to reproduce
Environment