Make flycheck-pos-tip-hide-messages work without minor mode#37
Open
bcc32 wants to merge 1 commit intoflycheck:masterfrom
Open
Make flycheck-pos-tip-hide-messages work without minor mode#37bcc32 wants to merge 1 commit intoflycheck:masterfrom
bcc32 wants to merge 1 commit intoflycheck:masterfrom
Conversation
This way, the package works as expected even when the user enables it by customizing flycheck-display-errors-function.
cpitclaudel
reviewed
Jul 3, 2025
Comment on lines
+106
to
+107
| (dolist (hook flycheck-pos-tip--hide-hooks) | ||
| (remove-hook hook #'flycheck-pos-tip-hide-messages)) |
Member
There was a problem hiding this comment.
Shouldn't this be out of the unless block?
Author
There was a problem hiding this comment.
No, that doesn't quite work. flycheck-pos-tip-hide-messages is called in post-command-hook so invoking any command that doesn't happen to move point would cause the hook to be removed if it was outside of the unless block.
Consider the following example operations:
- Move point onto a highlighted error. Wait a bit, then the tooltip will be displayed.
- Press
C-h .(or even justC-g, etc.) which is a command that does not change current-buffer, buffer-modified-tick, or point - Move point off of the error. This should hide the tooltip
With the suggested snippet moved outside of the unless block, (3) does not hide the error as it should.
(Sorry for the delay, I had a lot of personal stuff going on recently.)
Member
|
Woops, I missed this PR. It looks good to me, I left one comment |
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.
This way, the package works as expected even when the user enables it
by customizing
flycheck-display-errors-function(or happens to savesuch a customization permanently after enabling
flycheck-pos-tip-mode).Fix #36.
The new implementation strategy is to add
flycheck-pos-tip-hide-messagesto the appropriate hooks temporarilywhen the display function is called, and remove it when the messages
are actually dismissed. This avoids depending on the minor mode being
enabled at all.
Now, the only job of the minor mode is to be able to interactively
toggle the value of
flycheck-display-errors-function.