Skip to content

"no #%module-begin binding in the module's language" -- but there is & code runs? #758

Open
@dandrake

Description

@dandrake

I'm doing the Beautiful Racket stackerizer tutorial: https://beautifulracket.com/stackerizer/intro.html and Racket mode is complaining:

module: no #%module-begin binding in the module’s language
  in: (module stackerizer-test "stackerizer.rkt" (#%module-begin (+ 1 2 3 4)))

My stackerizer.rkt file is:

#lang br/quicklang

(provide + *)

(define-macro (stackerizer-mb EXPR)
  #'(#%module-begin
     EXPR))

(provide (rename-out [stackerizer-mb #%module-begin]))

(define-macro-cases +
  [(+ FIRST) #'FIRST]
  [(+ FIRST NEXT ...) #'(list 'dyadd FIRST (+ NEXT ...))])

When I send the code from my stackerizer-test buffer, it works exactly as expected. My understanding is that the (provide (rename-out.... is, well, providing the #%module-begin binding that Racket mode is looking for in the other buffer.

Is Racket mode not correctly interperting that rename? If I change the "stackerizer-mb" macro's name to #%module-begin, things work as expected, so it seems like the rename-out isn't being parsed.

Below is the racket-bug-report output:

Please copy all of the following lines and paste them into your bug report
at https://github.com/greghendershott/racket-mode/issues/.

Package

metadata
(#s(package-desc racket-mode (20250609 1522)
                 "Racket editing, REPL, and more."
                 ((emacs (25 1)) (compat (30 0 2 0))) nil nil
                 "/home/dan/.emacs.d/elpa/racket-mode-20250609.1522"
                 ((:authors
                   ("Greg Hendershott"
                    . "[email protected]"))
                  (:revdesc . "4395797ff130")
                  (:commit . "4395797ff130fcdcc9750fb2456d4f762d56852f")
                  (:url . "https://www.racket-mode.com/"))
                 nil))
package-archives
(("gnu" . "https://elpa.gnu.org/packages/")
 ("melpa" . "https://melpa.org/packages/"))
racket--el-source-dir
"/home/dan/.emacs.d/elpa/racket-mode-20250609.1522/"
racket--rkt-source-dir
"/home/dan/.emacs.d/elpa/racket-mode-20250609.1522/racket/"

System values

emacs-version
"30.1"
major-mode
racket-mode
system-type
gnu/linux
x-gtk-use-system-tooltips
t
display-graphic-p
t

Buffer values

after-change-functions
(jit-lock-after-change pulsar--after-change-function
                       flyspell-after-change-function t
                       racket--xp-after-change-hook)
before-change-functions
(t syntax-ppss-flush-cache)
completion-at-point-functions
(racket-xp-complete-at-point)
eldoc-documentation-function
eldoc-documentation-default
eldoc-documentation-strategy
eldoc-documentation-default
eldoc-documentation-functions
(racket-xp-eldoc-point racket-xp-eldoc-sexp-app t)
font-lock-defaults
((racket-font-lock-keywords-level-0 racket-font-lock-keywords-level-1
                                    racket-font-lock-keywords-level-2
                                    racket-font-lock-keywords-level-3)
 nil nil nil nil (font-lock-mark-block-function . mark-defun)
 (parse-sexp-lookup-properties . t) (font-lock-multiline . t)
 (font-lock-syntactic-face-function
  . racket-font-lock-syntactic-face-function)
 (font-lock-extend-region-functions font-lock-extend-region-wholelines
                                    font-lock-extend-region-multiline))
pre-command-hook
(eldoc-pre-command-refresh-echo-area t flyspell-pre-command-hook)
post-command-hook
(jit-lock--antiblink-post-command eldoc-schedule-timer
                                  pulsar--post-command-pulse
                                  completion-preview--post-command t
                                  flyspell-post-command-hook)
post-self-insert-hook
(electric-pair-post-self-insert-function
 electric-pair-open-newline-between-pairs-psif
 electric-indent-post-self-insert-function
 blink-paren-post-self-insert-function)
xref-backend-functions
(racket-xp-xref-backend-function racket-mode-xref-backend-function t)

Racket Mode values

racket--cmd-open-p
t
racket-after-run-hook
nil
racket-back-end-configurations
((:directory "/" :racket-program nil :remote-source-dir nil
             :restart-watch-directories nil :windows nil))
racket-before-run-hook
(racket-ansi-color-context-reset)
racket-browse-url-function
browse-url-default-browser
racket-command-timeout
10
racket-doc-index-directory
"~/.emacs.d/racket-mode/"
racket-doc-index-predicate-function
always
racket-documentation-search-location
"https://docs.racket-lang.org/search/index.html?q=%s"
racket-error-context
medium
racket-expand-hiding
standard
racket-hash-lang-mode-hook
nil
racket-hash-lang-module-language-hook
nil
racket-hash-lang-token-face-alist
((builtin . font-lock-builtin-face) (constant . font-lock-constant-face)
 (error . error) (operator . font-lock-operator-face)
 (other . font-lock-doc-face) (keyword . font-lock-keyword-face)
 (hash-colon-keyword . racket-keyword-argument-face)
 (at . font-lock-doc-face))
racket-history-filter-regexp
"\\`\\s *\\'"
racket-imagemagick-props
nil
racket-images-do-not-use-svg
nil
racket-images-inline
t
racket-images-keep-last
100
racket-images-system-viewer
"display"
racket-indent-curly-as-sequence
t
racket-indent-sequence-depth
0
racket-input-prefix
"\\"
racket-input-translations
(("All" "∀") ("Union" "U") ("Intersection" "∩")
 ("test-->>E" "test-->>∃") ("vdash" "⊢") ("gg" "≫") ("succ" "≻")
 ("times" "×") ("Uparrow" "⇑") ("Downarrow" "⇓") ("Leftarrow" "⇐")
 ("Rightarrow" "⇒") ("leftarrow" "←") ("rightarrow" "→") ("nwarrow" "↖")
 ("nearrow" "↗") ("uparrow" "↑") ("downarrow" "↓") ("searrow" "↘")
 ("swarrow" "↙") ("leftrightarrow" "↔") ("updownarrow" "⇕")
 ("aleph" "א") ("emptyset" "∅") ("nabla" "∇") ("surd" "√")
 ("negation" "¬") ("infinity" "∞") ("prod" "∏") ("coprod" "∐")
 ("integrate" "∫") ("oint" "∮") ("vee" "∨") ("wedge" "∧")
 ("follows" "∘") ("setin" "∈") ("ni" "∋") ("notin" "∉") ("sqsubset" "⊏")
 ("sqsupset" "⊐") ("sqsubseteq" "⊑") ("sqsupseteq" "⊒") ("subset" "⊂")
 ("superset" "⊃") ("subseteq" "⊆") ("supseteq" "⊇") ("approx" "≈")
 ("cong" "≌") ("neq" "≠") ("sqcap" "⊓") ("sqcup" "⊔") ("models" "⊧")
 ("alpha" "α") ("Alpha" "Α") ("beta" "β") ("Beta" "Β") ("gamma" "γ")
 ("Gamma" "Γ") ("delta" "δ") ("Delta" "Δ") ("epsilon" "ε")
 ("Epsilon" "Ε") ("zeta" "ζ") ("Zeta" "Ζ") ("eta" "η") ("Eta" "Η")
 ("theta" "θ") ("Theta" "Θ") ("iota" "ι") ("Iota" "Ι") ("kappa" "κ")
 ("Kappa" "Κ") ("lambda" "λ") ("Lambda" "Λ") ("lamda" "λ") ("Lamda" "Λ")
 ("mu" "μ") ("Mu" "Μ") ("nu" "ν") ("Nu" "Ν") ("xi" "ξ") ("Xi" "Ξ")
 ("omicron" "ο") ("Omicron" "Ο") ("pi" "π") ("Pi" "Π") ("rho" "ρ")
 ("Rho" "Ρ") ("sigma" "σ") ("Sigma" "Σ") ("tau" "τ") ("Tau" "Τ")
 ("upsilon" "υ") ("Upsilon" "Υ") ("phi" "φ") ("Phi" "Φ") ("chi" "χ")
 ("Chi" "Χ") ("psi" "ψ") ("Psi" "Ψ") ("omega" "ω") ("Omega" "Ω")
 ("digamma" "ϝ") ("Digamma" "Ϝ") ("san" "ϻ") ("San" "Ϻ") ("qoppa" "ϙ")
 ("Qoppa" "Ϙ") ("sampi" "ϡ") ("Sampi" "Ϡ") ("stigma" "ϛ") ("Stigma" "Ϛ")
 ("heta" "ͱ") ("Heta" "Ͱ") ("sho" "ϸ") ("Sho" "Ϸ") ("|A|" "𝔸")
 ("|B|" "𝔹") ("|C|" "ℂ") ("|D|" "𝔻") ("|E|" "𝔼") ("|F|" "𝔽") ("|G|" "𝔾")
 ("|H|" "ℍ") ("|I|" "𝕀") ("|J|" "𝕁") ("|K|" "𝕂") ("|L|" "𝕃") ("|M|" "𝕄")
 ("|N|" "ℕ") ("|O|" "𝕆") ("|P|" "ℙ") ("|Q|" "ℚ") ("|R|" "ℝ") ("|S|" "𝕊")
 ("|T|" "𝕋") ("|U|" "𝕌") ("|V|" "𝕍") ("|W|" "𝕎") ("|X|" "𝕏") ("|Y|" "𝕐")
 ("|Z|" "ℤ") ("|gamma|" "ℽ") ("|Gamma|" "ℾ") ("|pi|" "ℼ") ("|Pi|" "ℿ")
 ("forall" "∀") ("exists" "∃") ("_0" "₀") ("_1" "₁") ("_2" "₂")
 ("_3" "₃") ("_4" "₄") ("_5" "₅") ("_6" "₆") ("_7" "₇") ("_8" "₈")
 ("_9" "₉") ("^0" "⁰") ("^1" "¹") ("^2" "²") ("^3" "³") ("^4" "⁴")
 ("^5" "⁵") ("^6" "⁶") ("^7" "⁷") ("^8" "⁸") ("^9" "⁹"))
racket-logger-config
((cm-accomplice . warning) (GC . info) (module-prefetch . warning)
 (optimizer . info) (racket/contract . error)
 (racket-mode-debugger . info) (sequence-specialization . info)
 (* . fatal))
racket-memory-limit
2048
racket-mode-hook
(flymake-racket-add-hook racket-xp-mode)
racket-module-forms
"\\s(\\(?:module[*+]?\\|library\\)"
racket-pretty-lambda
nil
racket-pretty-print
t
racket-program
"racket"
racket-repl-buffer-name-function
nil
racket-repl-command-file
"/home/dan/.emacs.d/racket-mode/repl.rkt"
racket-repl-echo-sent-expressions
t
racket-repl-history-directory
"~/.emacs.d/racket-mode/"
racket-repl-mode-hook
nil
racket-sexp-comment-fade
0.5
racket-shell-or-terminal-function
racket-shell
racket-show-functions
(racket-show-pseudo-tooltip)
racket-smart-open-bracket-enable
nil
racket-submodules-to-run
((test) (main))
racket-use-repl-submit-predicate
nil
racket-xp-add-binding-faces
nil
racket-xp-after-change-refresh-delay
1
racket-xp-eldoc-level
summary
racket-xp-highlight-unused-regexp
"^[^_]"
racket-xp-mode-lighter
(:eval (racket--xp-mode-lighter))

Minor modes

enabled
((abbrev-mode) (auto-composition-mode) (auto-compression-mode)
 (auto-encryption-mode) (column-number-mode) (completion-preview-mode)
 (context-menu-mode) (desktop-save-mode) (display-line-numbers-mode)
 (display-time-mode) (eldoc-mode) (electric-indent-mode)
 (electric-pair-mode) (file-name-shadow-mode) (flyspell-mode)
 (font-lock-mode) (global-auto-revert-mode)
 (global-display-line-numbers-mode) (global-edit-server-edit-mode)
 (global-eldoc-mode) (global-font-lock-mode) (global-git-commit-mode)
 (global-hi-lock-mode) (global-ligature-mode) (hi-lock-mode)
 (ligature-mode) (line-number-mode) (magit-auto-revert-mode)
 (marginalia-mode) (minibuffer-regexp-mode) (mouse-wheel-mode)
 (override-global-mode) (persistent-scratch-autosave-mode)
 (pulsar-global-mode) (pulsar-mode) (racket-xp-mode)
 (rainbow-delimiters-mode) (recentf-mode) (repeat-mode)
 (save-place-mode) (savehist-mode) (semantic-minor-modes-format)
 (server-mode) (show-paren-mode) (size-indication-mode) (tab-bar-mode)
 (tooltip-mode) (transient-mark-mode) (vertico-mode) (which-key-mode))
Disabled minor modes
disabled
((2C-mode) (ace-window-display-mode) (ace-window-mode)
 (auto-fill-function) (auto-fill-mode) (auto-revert-mode)
 (auto-revert-tail-mode) (auto-save-mode) (auto-save-visited-mode)
 (avy-linum-mode) (blink-cursor-mode) (buffer-face-mode)
 (buffer-read-only) (button-mode) (calendar-follow-mode)
 (checkdoc-minor-mode) (cl-old-struct-compat-mode)
 (comint-fontify-input-mode) (compilation-minor-mode)
 (compilation-shell-minor-mode) (completion-in-region-mode)
 (completion-preview-active-mode) (cursor-face-highlight-mode)
 (cursor-intangible-mode) (cursor-sensor-mode) (dash-fontify-mode)
 (defining-kbd-macro) (diff-auto-refine-mode) (diff-minor-mode)
 (dired-click-to-select-mode) (dired-hide-details-mode)
 (dired-isearch-filenames-mode) (doc-view-minor-mode)
 (doc-view-presentation-mode) (edebug-backtrace-mode) (edebug-mode)
 (edit-server-edit-mode) (electric-layout-mode) (electric-quote-mode)
 (flymake-mode) (git-commit-mode) (global-completion-preview-mode)
 (global-dash-fontify-mode) (global-hl-line-mode)
 (global-prettify-symbols-mode) (global-semantic-highlight-edits-mode)
 (global-semantic-highlight-func-mode)
 (global-semantic-show-parser-state-mode)
 (global-semantic-show-unmatched-syntax-mode)
 (global-semantic-stickyfunc-mode) (global-visual-line-mode)
 (gnus-dead-summary-mode) (gnus-undo-mode) (header-line-indent-mode)
 (hl-line-mode) (horizontal-scroll-bar-mode) (hs-minor-mode)
 (ibuffer-auto-mode) (image-minor-mode) (indent-tabs-mode)
 (isearch-fold-quotes-mode) (isearch-mode) (ispell-minor-mode)
 (iswitchb-mode) (jit-lock-debug-mode) (llama-fontify-mode)
 (lock-file-mode) (lost-selection-mode) (magit-blame-mode)
 (magit-blame-read-only-mode) (magit-blob-mode)
 (magit-wip-after-apply-mode) (magit-wip-after-save-local-mode)
 (magit-wip-after-save-mode) (magit-wip-before-change-mode)
 (magit-wip-initial-backup-mode) (magit-wip-mode) (mail-abbrevs-mode)
 (markdown-live-preview-mode) (mastodon-profile-mode)
 (mastodon-profile-update-mode) (mastodon-search-mode)
 (mastodon-toot-mode) (menu-bar-mode) (midnight-mode) (mml-mode)
 (modifier-bar-mode) (next-error-follow-minor-mode) (org-cdlatex-mode)
 (org-list-checkbox-radio-mode) (org-src-mode)
 (org-table-follow-field-mode) (org-table-header-line-mode)
 (orgtbl-mode) (outline-minor-mode) (overwrite-mode)
 (paragraph-indent-minor-mode) (persistent-scratch-mode)
 (prettify-symbols-mode) (racket-hash-lang-repl-mode)
 (racket-input-mode) (racket-smart-open-bracket-mode)
 (read-extended-command-mode) (read-passwd-mode)
 (semantic-highlight-edits-mode) (semantic-highlight-func-mode)
 (semantic-mode) (semantic-show-parser-state-mode)
 (semantic-show-unmatched-syntax-mode) (semantic-stickyfunc-mode)
 (sh-electric-here-document-mode) (shell-command-with-editor-mode)
 (shell-dirtrack-mode) (shell-highlight-undef-mode) (smerge-mode)
 (tab-bar-history-mode) (temp-buffer-resize-mode) (text-scale-mode)
 (tool-bar-mode) (transient-resume-mode) (treesit-explore-mode)
 (treesit-inspect-mode) (undelete-frame-mode) (url-handler-mode)
 (use-hard-newlines) (vc-dir-git-mode) (view-mode) (visible-mode)
 (visual-line-mode) (which-function-mode) (window-divider-mode)
 (with-editor-mode) (xref-etags-mode))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions