Say who is talking, when Projectile speaks unprompted - #2141
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Projectile had five message conventions in one file: 12 sites said
Projectile:,3 said
Projectilebare, 3 led with the project name, 11 passed a stringstraight through, and 31 said nothing at all. The same event could come out two
ways -
Invalidated Projectile cache for Xfrom the command,Projectile: invalidating the cache of Xfrom a watch.The manual, for the record, mandates no package prefix. It asks for no terminal
punctuation, suggests
some-function:only "occasionally", and specifies theOperating.../Operating...doneidiom. Practice varies:project.elandvc.eluse no prefix, magit mostly doesn't, flycheck is mixed, and eglot -in core - defines a helper that prefixes
[eglot]. That last is the precedentfollowed here.
One rule now, drawn along the line
projectile-verbosealready established:[Projectile], suppressed byprojectile-verbose. Bothcome from one helper, which also retires fourteen hand-written
(when projectile-verbose (message ...))forms.the echo area is narrow.
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 somethingdifferent and compose badly with a package prefix; the
%spassthroughs in thesearch/replace UIs, which have their own buffer for context; and the six
display-warningcalls, which already render asWarning (projectile):.Two manual conventions came along with it: terminal punctuation is gone from the
prefixed set, and the indexing notice now pairs
Indexing X...withIndexing X...done- it previously had a space before its ellipsis (which themanual calls out) and never closed, so a long index left the echo area claiming
to still be working.