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

Make after-change-function save match data. #1741

Merged

Conversation

kenmanheimer
Copy link
Contributor

@kenmanheimer kenmanheimer commented Jan 9, 2020

PR Summary

elpy-folding--mark-foldable-lines was disrupting editing activities, like query replace, because it failed to save match data. This PR fixes that, wrapping the effective body of the function in save-match-data. I also wrapped resulting long lines.

PR checklist

Please make sure that the following things have been addressed (and check the relevant checkboxes):

  • Commits respect our guidelines
  • Tests are passing properly (see here on how to run Elpy's tests)

For new features only:

  • Tests has been added to cover the change
  • The documentation has been updated

elpy-folding--mark-foldable-lines disrupts editing activities, like
query replace, because it fails to save match data.

Here's relevant instructions from the Elisp Manual (in Emacs 26.3):

32.30 Change Hooks
 ...
"The functions you use in these hooks should save and restore the match data if they do anything that uses regular expressions; otherwise, they will interfere in bizarre ways with the editing operations that call them."
@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 92.308% when pulling ff21e8e on kenmanheimer:klm-fix-folding-disruption into a698cfd on jorgenschaefer:master.

@galaunay
Copy link
Collaborator

Legitimate, thanks for the PR.

I am happy to see that someone is using the folding module.
It has been implemented not so long ago, so feel free to reach us if it is misbehaving (again) or if you have ideas to make it better.

@galaunay galaunay merged commit 29b81d9 into jorgenschaefer:master Jan 12, 2020
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.

None yet

3 participants