Replace if-let with dash's -if-let - #176
Open
Wilfred wants to merge 1 commit into
Open
Conversation
if-let lives in subr-x, which deadgrep never requires, so it only worked because something else happened to load subr-x (or because newer Emacsen preload it). It is also declared obsolete in Emacs 31 in favour of if-let*, which doesn't exist on Emacs 25. Use -if-let from dash, which is already a dependency and matches the -when-let usage elsewhere in the file. Also remove a duplicated setq of deadgrep--current-file in deadgrep--stop-and-reset. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MwUBSSJnCtCeoqJEA3xH48
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.
deadgrep--visit-resultusesif-let, which lives insubr-x— a feature deadgrep neverrequires. It has worked by accident (newer Emacsen preload it, or another library loads it first), andif-letis declared obsolete in Emacs 31 in favour ofif-let*, which doesn't exist on Emacs 25 (the minimum supported version).Switching to dash's
-if-letsidesteps both problems: dash is already a hard dependency, and the file already uses-when-letelsewhere, so this is also more consistent.Also removes a duplicated
(setq deadgrep--current-file nil)indeadgrep--stop-and-reset(drive-by cleanup).No user-visible behaviour change. Verified: byte-compiles cleanly with
byte-compile-error-on-warnand all 38 tests pass on Emacs 29.3.🤖 Generated with Claude Code
https://claude.ai/code/session_01MwUBSSJnCtCeoqJEA3xH48
Generated by Claude Code