Skip to content

Replace if-let with dash's -if-let - #176

Open
Wilfred wants to merge 1 commit into
masterfrom
claude/replace-if-let-with-dash
Open

Replace if-let with dash's -if-let#176
Wilfred wants to merge 1 commit into
masterfrom
claude/replace-if-let-with-dash

Conversation

@Wilfred

@Wilfred Wilfred commented Aug 16, 2026

Copy link
Copy Markdown
Owner

deadgrep--visit-result uses if-let, which lives in subr-x — a feature deadgrep never requires. It has worked by accident (newer Emacsen preload it, or another library loads it first), and if-let is declared obsolete in Emacs 31 in favour of if-let*, which doesn't exist on Emacs 25 (the minimum supported version).

Switching to dash's -if-let sidesteps both problems: dash is already a hard dependency, and the file already uses -when-let elsewhere, so this is also more consistent.

Also removes a duplicated (setq deadgrep--current-file nil) in deadgrep--stop-and-reset (drive-by cleanup).

No user-visible behaviour change. Verified: byte-compiles cleanly with byte-compile-error-on-warn and all 38 tests pass on Emacs 29.3.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MwUBSSJnCtCeoqJEA3xH48


Generated by Claude Code

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