Skip to content

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

Open
farrellm wants to merge 1 commit into
tpapp:masterfrom
farrellm:use-starred-let-macros
Open

farrellm wants to merge 1 commit into
tpapp:masterfrom
farrellm:use-starred-let-macros

Conversation

@farrellm

Copy link
Copy Markdown

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
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.

1 participant