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
Rework #166
Rework #166
Conversation
42c4267
to
47205a4
Compare
Now most tests are passing on my machine... however, CI seems to choke on Edit: Seems like it is added in emacs 27.1... |
My general approach to backwards compatibility has always been that With that said, if we are using/relying on a single Emacs 27.1 function in our code, changing the CI-setup won't fix our actual underlying problem... Could we maybe conditionally monkey patch that function too? Wouldn't that be enough? |
Just FYI: I've now updated the CI in git master, and ... it actually breaks for Emacs 27.1 there, with the following test-failure: So current master isn't perfect either in the current Emacs versions we should support. |
Yeah, I think 24.4 is a very low version number. My fix for that 27.1 function was actually not to declare it. We used the same as java anyways, so now it follows what java does for all versions. That seemed to fix it. I'm absolutely in favour of the debian support strategy, and think 26.1 should be enough. However, emacs is strict on backwards compatibility... I think CC Mode should decide, and right now we follow CC Mode through history. I'd rather count csharp-mode overriding CC Mode defaults causing it to break a bug. |
Ok, now only some fontification tests are failing. I think (correct me if I'm wrong) that the most important here of them is the end of literal strings backslash test. That messes up Windows paths at least, right? I don't know how to fix that with what CC mode offers. I think it is a bug in CC Mode actually. However, I'm not sure that what Alan sees as multiline strings also are literal strings. If we use What do you think, @josteink? |
852184f
to
f4bbf8d
Compare
Yeah, I know, but as mentioned here, I am very wary of adding this to However, if it is impossible to handle without, I guess we do need that code. |
It isn't impossible, just the easiest solution I've found good code examples for at that time. What Alan proposes here is to use "either or both of c-get-state-before-change-functions and c-before-font-lock-functions", and indeed, it seems that cc-engine.el and cc-fonts.el contain non-trivial code to handle raw C++ strings. If you can make sense of that code, feel free to do better than me. |
Reading it like that makes it seem like it might cause more issues than it solves? Not sure.
If I had to chose, I would certainly prefer mostly working except multi-line strings (which is not used that often?), rather than random bugs throughout the major-mode, across different features. |
I'm absolutely not saying I either can make sense, or do better - just wanted to heed his warnings. And as far as for inclusion in emacs, I'd guess not doing this would be a prerequisite.
I believe so yes, and this is also the reason I wanted to do this rewrite. If more and more of these creep in, I'm not sure we've won anything. However, if this is a real issue that needs to be solved before merging to master, then we should absolutely fix it. If not, I can add it to my todo-list, and try to make sense of things later on. |
I'm just one vote in this whole Emacs-verse, but to me, the times I'm using multi-line strings is fairly limited. I wouldn't call it a pre-requisite to get things into master. If anything, getting this into master should let us know the scope of the problem 🤠 |
Well, you have been here for a while, so I think your vote at least gets a deciding weight.
I agree. We can always revert 🥴 Should I comment out failing tests, or let master build fail? |
I prefer the build to be green when we consider the release good. If we decide that these features are not important enough to be a requirement to be in master, then we should comment out/disable the test-cases and tests for those features to, to keep the build green. So yes, IMO:
With those 2 aspects of those 2 test-cases taken out, the build should be green, and we should be good to merge :) |
4bc4ee1
to
87631fe
Compare
Started from scratch, following only CC Mode api and directives. There is one monkey pach still haunting us, but hopefully we can remove it soon(tm).
87631fe
to
134eeb6
Compare
It's passing! However, I had to comment out the whole tests, not only the aspects. It comes down to two things:
What do you think? Should l work more on this, or create a new issue for the compiler directives thing afterwards? |
That shouldn't really be needed. Let me see if I can make them pass with some slight modifications. |
Ok so quick reality-check:
So with that said, I've fixed |
Yeah, This is the
That is great! Thank you! |
- Still doesn't work with trailing slashies. Comment out test-case!
There. Done. (Assuming build goes green) |
Yay, we are green. Thanks, all! |
The Looking at the compatibility with previous versions of Emacs before 26.1... The test-suite seems to run fine for most aspects apart from the "big" indentation-test. That's not anywhere near being completely broken, and might even be usable for day-to-day work, so I think that's fine. As long as Good to go! And at this point, it would be completely unfair for me to click the big, bad "merge"-button. You rewrote this thing from scratch. You did all the heavy-lifting. You get the honours :) The show is all yours @theothornhill ! |
That is fantastic! Thank you for all your help!!
Thanks :)
oOo! |
I'm not sure how many bugs this single effort has fixed, but the oldest one is like 5 years old, and you got it all done in about a week's worth of effort. Absolutely amazing. You're a hero, man! 👍 |
I really hope keeping things simple will aid in this onwards! That CC Mode is complicated enough
My pleasure! It was great fun :) I'll stick around and fix whatever bugs I caused :) |
Oh you'll have great fun in the future too, have no worries. Bugs will always come to those who wait. 😁 As this is largely your code now... Do you have feelings wrt getting it mainlined? |
Haha! ✌️
I think it is worth the effort, absolutely. With the move towards However, CC Mode needs to adapt to modes not already in CC Mode, to avoid that sort of monkey patching. So:
Also, it's not like C# is a more niche language than Simula and Modula 2 :) |
Hehe. Sounds reasonable. No need to rush things 👍 |
I think it may be time to merge this rework to master now.
it fixes #165 (obviously), #162, #154, #128, #114, #105, #84 and #46,
I think it is time to take a good look at it and see if something isn't in the correct basket. However, I don't think it is dangerous to merge to master stability-wise, since it now only relies on CC Mode and follows that api (apart from that one monkey patch that sneaked back in)
Should that new function be advised, or is it okay to just re-eval it here?
What do you think, @josteink?