Skip to content

Say who is talking, when Projectile speaks unprompted - #2141

Merged
bbatsov merged 1 commit into
masterfrom
feature/message-prefix
Jul 29, 2026
Merged

Say who is talking, when Projectile speaks unprompted#2141
bbatsov merged 1 commit into
masterfrom
feature/message-prefix

Conversation

@bbatsov

@bbatsov bbatsov commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Projectile had five message conventions in one file: 12 sites said Projectile:,
3 said Projectile bare, 3 led with the project name, 11 passed a string
straight through, and 31 said nothing at all. The same event could come out two
ways - Invalidated Projectile cache for X from the command,
Projectile: invalidating the cache of X from a watch.

The manual, for the record, mandates no package prefix. It asks for no terminal
punctuation, suggests some-function: only "occasionally", and specifies the
Operating.../Operating...done idiom. Practice varies: project.el and
vc.el use no prefix, magit mostly doesn't, flycheck is mixed, and eglot -
in core - defines a helper that prefixes [eglot] . That last is the precedent
followed here.

One rule now, drawn along the line projectile-verbose already established:

  • Unprompted -> [Projectile] , suppressed by projectile-verbose. Both
    come from one helper, which also retires fourteen hand-written
    (when projectile-verbose (message ...)) forms.
  • A command answering for itself -> unprefixed. You know who is talking and
    the echo area is narrow.
  • Asked for, but arriving later out of a sentinel or timer (the async
    indexer, the dashboard's index button) -> prefixed but never suppressed. By
    then the prefix is the only thing identifying the source.

Bracket form over Projectile: because it matches eglot, greps cleanly in
*Messages*, and stays legible when the message itself contains a colon.

Left alone deliberately: the three [project-name] messages, which say something
different and compose badly with a package prefix; the %s passthroughs in the
search/replace UIs, which have their own buffer for context; and the six
display-warning calls, which already render as Warning (projectile):.

Two manual conventions came along with it: terminal punctuation is gone from the
prefixed set, and the indexing notice now pairs Indexing X... with
Indexing X...done - it previously had a space before its ellipsis (which the
manual calls out) and never closed, so a long index left the echo area claiming
to still be working.

Five conventions across one file: 12 messages said "Projectile: ", 3
said "Projectile ", 3 led with the project name, 11 passed a string
straight through and 31 said nothing at all. The same event could be
reported two ways - "Invalidated Projectile cache for X" from the
command, "Projectile: invalidating the cache of X" from a watch.

One rule now, along the line projectile-verbose already drew. What
Projectile says off its own bat is prefixed [Projectile] and suppressed
with projectile-verbose, both from one helper - which also retires
fourteen hand-written (when projectile-verbose (message ...)) forms.
What answers a command you just invoked stays unprefixed: you know who
is talking, and the echo area is narrow. What you asked for but which
arrives later, out of a sentinel or a timer, is prefixed but never
suppressed.

The bracket form follows eglot, which does this in core, and stays
legible when the message itself contains a colon - several do.

Two conventions from the manual came along: no terminal punctuation, and
the Operating.../Operating...done pairing for the indexing notice, which
previously opened with a space before its ellipsis and never closed.
@bbatsov
bbatsov merged commit 71e8f9c into master Jul 29, 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