Skip to content

Use if-let*/when-let* (if-let/when-let obsolete in Emacs 31) - #164

Merged
tpapp merged 2 commits into
tpapp:masterfrom
farrellm:use-starred-let-macros
Sep 22, 2026
Merged

tpapp merged 2 commits into
tpapp:masterfrom
farrellm:use-starred-let-macros

Conversation

@farrellm

Copy link
Copy Markdown
Contributor

Emacs 31.1 marked if-let, when-let and and-let obsolete in favour of the starred variants.

Because julia-repl.el sets no-byte-compile: t, the file is macroexpanded at load time, so on Emacs 31 these warnings appear for every user whenever julia-repl is loaded — not just when someone byte-compiles it:

julia-repl.el: Warning: ‘if-let’ is an obsolete macro (as of 31.1); use ‘if-let*’ instead. [5 times]
julia-repl.el: Warning: ‘when-let’ is an obsolete macro (as of 31.1); use ‘when-let*’ or ‘and-let*’ instead.

All six call sites bind a single variable, so if-let*/when-let* are exactly equivalent here. Both macros have existed since Emacs 26.1, well below the package's 29.1 requirement, so this needs no change to Package-Requires.

Tested with the repo's ert suite on Emacs 31.1 (4/4 passing), and the warnings are gone on load.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ETZ3Po9TDsuH7aNhtvkZcb

Emacs 31.1 marked `if-let', `when-let' and `and-let' obsolete in favour
of the starred variants.  Because julia-repl.el sets `no-byte-compile:
t', it is macroexpanded at load time, so every Emacs 31 user sees these
warnings whenever julia-repl is loaded:

    julia-repl.el: Warning: ‘if-let’ is an obsolete macro (as of 31.1); use ‘if-let*’ instead. [5 times]
    julia-repl.el: Warning: ‘when-let’ is an obsolete macro (as of 31.1); use ‘when-let*’ or ‘and-let*’ instead.

All six call sites bind a single variable, so the rewrite is
semantics-preserving.  `if-let*' and `when-let*' have existed since
Emacs 26.1, well below the package's 29.1 requirement.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ETZ3Po9TDsuH7aNhtvkZcb
@tpapp

tpapp commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Thanks! Can you please add 30.2 and 31.1 to the CI matrix in this PR?

@tpapp

tpapp commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Did that in #165, just merge master

@farrellm

Copy link
Copy Markdown
Contributor Author

Thanks! Merged master.

@tpapp tpapp left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@tpapp
tpapp merged commit 7c81816 into tpapp:master Sep 22, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants