Skip to content

Address the non-blocker findings from the 3.1 review#2082

Merged
bbatsov merged 5 commits into
masterfrom
improve/v3.1-review-followups
Jul 8, 2026
Merged

Address the non-blocker findings from the 3.1 review#2082
bbatsov merged 5 commits into
masterfrom
improve/v3.1-review-followups

Conversation

@bbatsov

@bbatsov bbatsov commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Follow-up to the bug-fix PR (#2081): the remaining nice-to-haves and test-coverage gaps the v3.1 review turned up. Five focused commits; the version-metadata bump is deliberately left out for now. 888 specs, clean --warnings-as-errors, relint clean.

Frecency

  • Add projectile-frecency-max-projects (default 100). The history capped files per project but not the number of roots, so churning through projects grew the store forever; the least recently active roots are now dropped on save. Tests: the cap, plus the previously-untested disk-newer-timestamp merge branch.

Reviewable search/replace

  • Give ripgrep its own :stderr so a diagnostic line can't split a match across filter chunks and get silently dropped.
  • Promote projectile-replace-scan-chunk-size to a public defcustom; type projectile-replace-max-matches as natnum.
  • Fix the projectile-replace--candidates docstring (the literal-narrowing helper matches case-insensitively - a safe superset).
  • Test the write-back skip when a live buffer is edited before a match between scan and apply.

Watch / mode lifecycle

  • Only arm file-notify watches from the option's :set when projectile-mode is on (otherwise they linger with no teardown).
  • Reset projectile--current-project when the mode is disabled, so projectile-project-changed-functions fires on the first re-entry after a re-enable.
  • Document the broken-symlink-marker semantics of the directory-listing detection.

Sessions / file kinds

  • projectile-session--read-file now messages when it skips a session written by an incompatible format version, instead of silently restoring nothing.
  • Drop the documented-but-unimplemented :file-fn key from projectile-related-files-fn's docstring.

Deliberately left for later: the 3.1.03.2.0 version-metadata reconciliation, the rg-vs-elisp full parity test / end-to-end rg subprocess test (need rg in CI), and a few pure nits (the dead tick struct slot, cl-position in the session code). The already-shipped tests cover the projectile-sort-order-as-function and fallback branches, so that gap was already closed.

bbatsov added 5 commits July 8, 2026 09:52
The frecency history bounded files per project but not the number of
project roots, so churning through many projects grew the store without
bound (dead roots persisted forever).  Add projectile-frecency-max-projects
(default 100); on save, keep the most recently active roots and drop the
rest, mirroring the existing per-project file cap.
- Keep ripgrep's stderr out of the JSON stdout stream (dedicated :stderr
  buffer), so a diagnostic line can't split a match across filter chunks
  and get silently dropped.
- Promote projectile-replace--scan-chunk-size to a public defcustom
  (projectile-replace-scan-chunk-size), since it's user-facing tuning.
- Type projectile-replace-max-matches as natnum, not integer.
- Correct the projectile-replace--candidates docstring: the literal
  narrowing helper matches case-insensitively (a safe superset), not
  case-sensitively.
- Cover the write-back skip when a live buffer is edited *before* a match
  between scan and apply (positions invalidated).
- Only arm file-notify watches from the auto-update option's :set when
  projectile-mode is on; arming with the mode off leaves watches with no
  teardown path until Emacs exits.
- Reset projectile--current-project when the mode is disabled, so
  re-enabling it fires projectile-project-changed-functions on the first
  re-entry into the last-seen project.
- Note the broken-symlink-marker semantics of the directory-listing
  detection (harmless, but different from the old file-exists-p probe).
- projectile-session--read-file now messages when it skips a real session
  file written by an incompatible format version, instead of silently
  restoring nothing.
- Drop the :file-fn mention from projectile-related-files-fn's docstring;
  it was documented but never implemented.
@bbatsov bbatsov merged commit 94fc502 into master Jul 8, 2026
10 checks passed
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.

1 participant