Skip to content

emacs: replace obsolete when-let to silence Emacs 31 warning#2076

Merged
voodoos merged 1 commit into
ocaml:mainfrom
dannywillems:fix/emacs-when-let-obsoletion
Jun 2, 2026
Merged

emacs: replace obsolete when-let to silence Emacs 31 warning#2076
voodoos merged 1 commit into
ocaml:mainfrom
dannywillems:fix/emacs-when-let-obsoletion

Conversation

@dannywillems
Copy link
Copy Markdown
Contributor

On Emacs 31.1 the byte-compiler reports when-let as obsolete (use
when-let* or and-let*). This silences the warning in
merlin--construct-point without raising the package's minimum Emacs.

Rather than switch to when-let* (which requires Emacs 26.1, while
emacs/merlin.el declares Package-Requires: ((emacs "25.1"))), the
single call site is rewritten with let + when, which is valid on
every Emacs version. Behaviour is unchanged.

Verified: balanced parens (check-parens) and no obsoletion warning on
byte-compile.

`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.
@dannywillems
Copy link
Copy Markdown
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
@dannywillems
Copy link
Copy Markdown
Contributor Author

@xvw
Copy link
Copy Markdown
Collaborator

xvw commented May 31, 2026

Thanks!

@voodoos voodoos closed this Jun 1, 2026
@voodoos voodoos reopened this Jun 1, 2026
Copy link
Copy Markdown
Collaborator

@voodoos voodoos left a comment

Choose a reason for hiding this comment

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

Thanks @dannywillems and @xvw for the review! Approving on your behalf.

@voodoos
Copy link
Copy Markdown
Collaborator

voodoos commented Jun 1, 2026

Hum, the CI is utterly broken, but that looks unrelated to this PR...

@voodoos voodoos added the no changelog Turn off CI changelog-check label Jun 1, 2026
@voodoos voodoos merged commit 653fdaa into ocaml:main Jun 2, 2026
1 of 11 checks passed
@dannywillems dannywillems deleted the fix/emacs-when-let-obsoletion branch June 2, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog Turn off CI changelog-check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants