Skip to content

Put the rest of the unsolicited messages behind projectile-verbose - #2140

Merged
bbatsov merged 1 commit into
masterfrom
feature/verbose-audit
Jul 28, 2026
Merged

Put the rest of the unsolicited messages behind projectile-verbose#2140
bbatsov merged 1 commit into
masterfrom
feature/verbose-audit

Conversation

@bbatsov

@bbatsov bbatsov commented Jul 28, 2026

Copy link
Copy Markdown
Owner

An audit of all 60 message call sites in projectile.el.

The good news is that the line projectile-verbose was drawing is the right
one - Projectile stays quiet about what it does off its own bat, and still
answers for what you asked it to do. It just wasn't drawn consistently: it
gated nine sites and missed five that belong on the same side of it.

  • Caching a file the find-file hook picked up. Fires for every newly
    cached file you open, which is the most frequent of the lot.
  • A search path entry that no longer exists. The automatic scan runs once a
    session, so a stale entry announces itself on every startup.
  • An indexing command that exited non-zero but produced usable output, in
    both the sync and async runners. The code's own comment already said to
    "mention it quietly"; the detail is in *projectile-files-errors* either way.
  • A session file from an older format version. projectile-session-restore-all
    can walk a directory full of these at startup.

Two of those are also commands in their own right, so they use the pattern
already established in projectile-discard-command-cache: quiet from a hook,
still speaking when you invoke them. There are specs for both sides of that.

Deliberately left alone:

  • Projectile is initializing cache for ... - it looks like noise in a test log,
    but it is the only warning that synchronous native indexing is about to take
    a while. The async path has a progress reporter; native has this.
  • Every message that is a command answering for itself. projectile-invalidate-cache
    saying nothing would leave you wondering whether it ran, and there is a spec
    pinning that it still speaks.

The option's docstring and the manual now describe what it actually covers,
rather than "echo messages that are not errors".

An audit of all 60 message call sites. The option gated nine of them,
and the line it was drawing was the right one - Projectile stays quiet
about what it does off its own bat, and still answers for what you asked
it to do - but five sites had been missed:

- caching a file the find-file hook just picked up, which fires for
  every newly cached file you open
- a search path entry that no longer exists, which the once-a-session
  automatic scan would otherwise report on every startup
- an indexing command that exited non-zero but produced usable output,
  in both the sync and async runners, whose own comment already said to
  mention it quietly
- a session file from an older format version, which
  projectile-session-restore-all can meet a whole directory of

Two of those are also commands in their own right, so they follow the
existing pattern and still speak when invoked interactively.

Deliberately left alone: the 'initializing cache' notice, which is the
only warning that synchronous native indexing is about to take a while,
and every message that is a command answering for itself.
@bbatsov
bbatsov merged commit e3e5afc into master Jul 28, 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