emacs: replace obsolete when-let to silence Emacs 31 warning#2076
Merged
Conversation
`when-let' was marked obsolete in Emacs 31.1. Rather than switch to `when-let*' (which requires Emacs 26.1 and would raise the package's declared minimum of 25.1), rewrite the single call site in merlin--construct-point with `let' + `when', which is valid on every Emacs version and keeps backward compatibility. Behaviour is unchanged.
Contributor
Author
|
This is an automated effort to help maintaining packages in the Emacs community. See https://x.com/dwillems42/status/2060720730338185699 |
dannywillems
added a commit
to dannywillems/emacs-package-maintenance
that referenced
this pull request
May 30, 2026
Contributor
Author
xvw
approved these changes
May 31, 2026
Collaborator
|
Thanks! |
voodoos
approved these changes
Jun 1, 2026
Collaborator
voodoos
left a comment
There was a problem hiding this comment.
Thanks @dannywillems and @xvw for the review! Approving on your behalf.
Collaborator
|
Hum, the CI is utterly broken, but that looks unrelated to this PR... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Emacs 31.1 the byte-compiler reports
when-letas obsolete (usewhen-let*orand-let*). This silences the warning inmerlin--construct-pointwithout raising the package's minimum Emacs.Rather than switch to
when-let*(which requires Emacs 26.1, whileemacs/merlin.eldeclaresPackage-Requires: ((emacs "25.1"))), thesingle call site is rewritten with
let+when, which is valid onevery Emacs version. Behaviour is unchanged.
Verified: balanced parens (
check-parens) and no obsoletion warning onbyte-compile.