Skip to content

Drop typst-ts-mode :pre-build once meow_king/typst-ts-mode#103 is fixed #2

Description

@stfl

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/103open, 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

  1. In config.org, delete the :pre-build and its comment block from the typst-ts-mode recipe.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions