Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't clobber match data in timer #1806

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

darkfeline
Copy link
Contributor

Fixes #1805

@CLAassistant
Copy link

CLAassistant commented Jun 19, 2020

CLA assistant check
All committers have signed the CLA.

@cpitclaudel
Copy link
Member

Thanks, excellent catch. Maybe we should actually put this in flycheck-buffer-automatically, to catch similar errors that may pop up from elsewhere?

@darkfeline
Copy link
Contributor Author

I'm not sure. The Emacs manual states that all functions are allowed to change match data, so there's nothing specifically wrong with flycheck-buffer-automatically overwriting match data. It's only timer functions that need to be careful. (I don't know why Emacs doesn't automatically save match data for timers like it does for process filters.)

@cpitclaudel
Copy link
Member

It's only timer functions

And change hooks, right? (we already have a save-match-data for that case). The fact that we had a save-match-data in one of the callers but missed it in the other (idle-trigger) suggests to me that we should just harden flycheck-buffer-automatically once and for all

@darkfeline
Copy link
Contributor Author

Okay, sure. I'm keeping the save-match-data in the timer and change hooks though, since I'm paranoid something may get added there in the future that changes match data again.

@cpitclaudel
Copy link
Member

OK, works for me :)

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.

Flycheck idle timer clobbers match data
3 participants