Skip to content

Fix incorrect assoc usage on string list in majutsu-base.el#29

Merged
0WD0 merged 2 commits intomajutsu-filefrom
copilot/sub-pr-24
Feb 1, 2026
Merged

Fix incorrect assoc usage on string list in majutsu-base.el#29
0WD0 merged 2 commits intomajutsu-filefrom
copilot/sub-pr-24

Conversation

Copy link

Copilot AI commented Feb 1, 2026

Addresses review feedback on PR #24: majutsu-buffer-diff-range is a list of strings like ("--revisions=@-") or ("--from=@-" "--to=@"), not an alist. Using assoc on it always returns nil.

Changes

  • Replace (cdr (assoc "--revisions=" range)) with seq-find + string-prefix-p pattern
  • Align with existing majutsu-file--diff-range-value implementation (lines 107-111)

Before:

(cdr (assoc "--revisions=" range))

After:

(when-let* ((arg (seq-find (lambda (item) (string-prefix-p "--revisions=" item)) range)))
  (substring arg (length "--revisions=")))

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Summary by CodeRabbit

  • Bug Fixes
    • Improved revision value extraction to handle more diverse input formats reliably.

✏️ Tip: You can customize this high-level summary in your review settings.

Co-authored-by: 0WD0 <68629279+0WD0@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP address feedback on blob buffer support implementation Fix incorrect assoc usage on string list in majutsu-base.el Feb 1, 2026
Copilot AI requested a review from 0WD0 February 1, 2026 08:56
@0WD0 0WD0 marked this pull request as ready for review February 1, 2026 08:56
Copilot AI review requested due to automatic review settings February 1, 2026 08:56
Repository owner deleted a comment from coderabbitai bot Feb 1, 2026
@0WD0 0WD0 merged commit 7081567 into majutsu-file Feb 1, 2026
5 checks passed
@coderabbitai
Copy link

coderabbitai bot commented Feb 1, 2026

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{"name":"HttpError","status":404,"request":{"method":"PATCH","url":"https://api.github.com/repos/0WD0/majutsu/issues/comments/3830663870","headers":{"accept":"application/vnd.github.v3+json","user-agent":"octokit.js/0.0.0-development octokit-core.js/7.0.6 Node.js/24","authorization":"token [REDACTED]","content-type":"application/json; charset=utf-8"},"body":{"body":"<!-- This is an auto-generated comment: summarize by coderabbit.ai -->\n<!-- This is an auto-generated comment: failure by coderabbit.ai -->\n\n> [!CAUTION]\n> ## Review failed\n> \n> The pull request is closed.\n\n<!-- end of auto-generated comment: failure by coderabbit.ai -->\n\n<!-- walkthrough_start -->\n\n## Walkthrough\n\nModified the revision value extraction logic in `majutsu-revision-at-point` to use `seq-find` and parse the \"--revisions=\" string suffix directly, replacing the previous alist-based approach with `assoc` and conditional `-r` handling.\n\n## Changes\n\n|Cohort / File(s)|Summary|\n|---|---|\n|**Revision Extraction Logic** <br> `majutsu-base.el`|Updated `majutsu-revision-at-point` to extract revision values by searching for items prefixed with \"--revisions=\" using `seq-find` and substring parsing, replacing assoc-based alist handling.|\n\n## Estimated code review effort\n\n🎯 2 (Simple) | ⏱️ ~8 minutes\n\n## Poem\n\n> A rabbit hops through revision trails,\n> Where parsing now with `seq-find` sails,\n> No more assoc in disarray,\n> String suffixes light the way! 🐰✨\n\n<!-- walkthrough_end -->\n\n\n<!-- tips_start -->\n\n---\n\n\n\n<sub>Comment `@coderabbitai help` to get the list of available commands and usage tips.</sub>\n\n<!-- tips_end -->\n\n<!-- internal state start -->\n\n\n<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKPR1AGxJcAYvAAeKBhMFBSiuOiIiPgMkNiIaKT8WIi4FPAYRJAeSBEZkMxoQngOYAJoiCQaJB6QkAYAco4ClFwATACckIAoBJAAqjYAMlywuLjciBwA9FNE6rDYAhpMzFMADADqACJrU4XFuA5T3NgeHlOddQZ9lRRcAML43PAe+BG9AMr42BQMJJACKjBWBcJjPV64KYOARgXhgNoAFh6MGcpAigMwDBBBSKJWwYAAZi9/p9cNR4lwnmRkTYSBJ4CQAO6USaQTY7AA0kEe4LeyPuYWodHQnEgbTWbQA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igYMqeHL1Ise0qzMeiPgPhfwYAHbZnyb2+A0D6XTa/7ygBomS4SpnCxMfrLdF2dAWB5oAhIHMDAt4+L3wOvXJ+y5VxYxQlyQSh9l613WsNdApVKBj1gaTWaPBcIBFZvHbM04IgJWwO1ReJAj7XlvB4e8cBUBZ0KsgWuREKArj4uRfOtAvB11JpJaSjpUjc0iHBJmfEHBRgCGBIuNd87ww8LIVcZo5yZjSlMa+PFsBiB+CQLkyleD4HpHxfsAh4i4Bchwj6ADq6FEOP5cwccPAkWoA3aiH1a5KAYC+G2XiJbCW4F2W2QCTgCByLEdg/1pAvUgA0M0JBXGQAALKYHjNICIfhBFWgwEeWQAAvSgRhBgZEdGw0gw9IBoTaFMMAcojAAFFUjKRTlrf4NZXTxWrqKNJdB4COAMNHCsL1/aB1FhDCWFtCBW1lsKBWGkuBUEdmnZw8hNYe2ULrH2Bt/ZAA=== -->\n\n<!-- internal state end -->"},"request":{"retryCount":1}},"response":{"url":"https://api.github.com/repos/0WD0/majutsu/issues/comments/3830663870","status":404,"headers":{"access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","content-encoding":"gzip","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Sun, 01 Feb 2026 08:58:45 GMT","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"github.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","transfer-encoding":"chunked","vary":"Accept-Encoding, Accept, X-Requested-With","x-accepted-github-permissions":"issues=write; pull_requests=write","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-api-version-selected":"2022-11-28","x-github-media-type":"github.v3; format=json","x-github-request-id":"B026:323144:39BF506:FAB706C:697F15C5","x-ratelimit-limit":"6400","x-ratelimit-remaining":"6110","x-ratelimit-reset":"1769936580","x-ratelimit-resource":"core","x-ratelimit-used":"290","x-xss-protection":"0"},"data":{"message":"Not Found","documentation_url":"https://docs.github.com/rest/issues/comments#update-an-issue-comment","status":"404"}}}

@0WD0 0WD0 deleted the copilot/sub-pr-24 branch February 1, 2026 08:58
@coderabbitai
Copy link

coderabbitai bot commented Feb 1, 2026

Oops, something went wrong! Please try again later. 🐰 💔

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug in majutsu-revision-at-point where assoc was incorrectly used on a list of strings, causing it to always return nil.

Changes:

  • Replace incorrect assoc usage with seq-find + string-prefix-p pattern to properly extract the revision value from majutsu-buffer-diff-range

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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