The typst-ts-mode package in config.org carries a :pre-build that rewrites an autoload cookie at build time, as a temporary workaround.
Upstream lives on Codeberg, not GitHub: https://codeberg.org/meow_king/typst-ts-mode
Why
On Emacs 31, loading typst-ts-mode-autoloads.el fails with:
Symbol's function definition is void: define-compilation-mode
typst-ts-compilation-mode in typst-ts-compile.el carries a bare ;;;###autoload cookie on its define-compilation-mode form. loaddefs-generate only reduces such a form to an autoload stub when the defining macro is loaded while autoloads are generated. define-compilation-mode comes from compile, which is not loaded at that point, so the raw form is copied into the autoloads file verbatim and fails at load time.
Same root cause as #1, which hit transient-define-prefix in beads.el.
Upstream status
Reported by a third party as https://codeberg.org/meow_king/typst-ts-mode/issues/103 — open, no PR. The issue is a bug report only; nothing upstream is in flight to follow.
Fix
One line in typst-ts-compile.el:
-;;;###autoload
+;;;###autoload (autoload 'typst-ts-compilation-mode "typst-ts-compile" nil t)
(define-compilation-mode typst-ts-compilation-mode "Typst Compilation"
Verified against upstream 155bb36 on Emacs 31.0.91 by generating autoloads with loaddefs-generate and loading the result:
|
before |
after |
| raw macro form in autoloads |
present |
gone |
| loading the autoloads file |
(void-function define-compilation-mode) |
loads clean, mode autoloaded |
Opening the PR needs a Codeberg account; that is the blocker, not the patch.
Action when it is fixed upstream
- In
config.org, delete the :pre-build and its comment block from the typst-ts-mode recipe.
doom sync — if the void-function error reappears, delete <straight>/build-*/typst-ts-mode/typst-ts-mode-autoloads.el first, since loaddefs-generate skips regeneration when the output file looks up to date.
The
typst-ts-modepackage inconfig.orgcarries a:pre-buildthat rewrites an autoload cookie at build time, as a temporary workaround.Upstream lives on Codeberg, not GitHub: https://codeberg.org/meow_king/typst-ts-mode
Why
On Emacs 31, loading
typst-ts-mode-autoloads.elfails with:typst-ts-compilation-modeintypst-ts-compile.elcarries a bare;;;###autoloadcookie on itsdefine-compilation-modeform.loaddefs-generateonly reduces such a form to an autoload stub when the defining macro is loaded while autoloads are generated.define-compilation-modecomes fromcompile, which is not loaded at that point, so the raw form is copied into the autoloads file verbatim and fails at load time.Same root cause as #1, which hit
transient-define-prefixinbeads.el.Upstream status
Reported by a third party as https://codeberg.org/meow_king/typst-ts-mode/issues/103 — open, no PR. The issue is a bug report only; nothing upstream is in flight to follow.
Fix
One line in
typst-ts-compile.el:Verified against upstream
155bb36on Emacs 31.0.91 by generating autoloads withloaddefs-generateand loading the result:(void-function define-compilation-mode)Opening the PR needs a Codeberg account; that is the blocker, not the patch.
Action when it is fixed upstream
config.org, delete the:pre-buildand its comment block from thetypst-ts-moderecipe.doom sync— if the void-function error reappears, delete<straight>/build-*/typst-ts-mode/typst-ts-mode-autoloads.elfirst, sinceloaddefs-generateskips regeneration when the output file looks up to date.