-
Notifications
You must be signed in to change notification settings - Fork 185
Fix emacs state corruption from incorrect "syntax-begin-function" setting #38
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
Conversation
r? @huonw (rust_highfive has picked a reviewer for you, use r? to override) |
could leave it inside parens if a fn appears inside them. | ||
|
||
Having said that, as I write this I don't understand fully what | ||
internal state was corruped and how. There wasn't an obvious |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: "corruped"
I have nits, but the fix seems as sound as far I understand it. So I'm going to land this PR, and file an issue asking @MicahChalmer to fix the comments. :) |
Oh, one more question: @MicahChalmer can you elaborate (or point to an elaboration elsewhere) on why #30 included that setq of |
Fix emacs state corruption from incorrect "syntax-begin-function" setting
I filed #40 to fix the typo and missing end of the comment. As to @pnkfelix's question of why I made the mistake of setting Of course, since I was also the one who put in the I didn't put the above in the comments in #40--I figured it's a bit more than needed for ongoing maintenance of the code. Let me know if you think it should go in anyway, and I can add it as another commit to #40. |
@MicahChalmer I haven't chance to work a lot on Rust today, but on a quick look everything was fine, thanks! |
It seems to have fixed things for me. Many thanks for tracking that down. |
This is to fix #36.
Commit 6b57bbf set
syntax-begin-function
tobeginning-of-defun
. This violated the contract for that function--it's supposed to get outside of all braces/parens--but functions could appear inside other blocks, sobeginning-of-defun
could end inside another pair of braces. This in turn caused emacs corrupt some unknown internal state and cause itself to think there were fewer parens than there were.The comments of the added test show how much I understood about the exact mechanism of the failure--which is not much. I figure it's better to just fix it and leave the test there. Though I don't understand the mechanism of the corruption, at least I understand how the code was violating the hook's contract. Hopefully there isn't some other similar corruption hiding out that I haven't found yet.
@vhbit and @hugoduncan, does this fix the issues you were seeing?