this post was submitted on 24 Aug 2026
28 points (100.0% liked)
technology
24451 readers
210 users here now
On the road to fully automated luxury gay space communism.
Spreading Linux propaganda since 2020
- Ways to run Microsoft/Adobe and more on Linux
- The Ultimate FOSS Guide For Android
- Great libre software on Windows
- Hey you, the lib still using Chrome. Read this post!
Rules:
- 1. Obviously abide by the sitewide code of conduct. Bigotry will be met with an immediate ban
- 2. This community is about technology. Offtopic is permitted as long as it is kept in the comment sections
- 3. Although this is not /c/libre, FOSS related posting is tolerated, and even welcome in the case of effort posts
- 4. We believe technology should be liberating. As such, avoid promoting proprietary and/or bourgeois technology
- 5. Explanatory posts to correct the potential mistakes a comrade made in a post of their own are allowed, as long as they remain respectful
- 6. No crypto (Bitcoin, NFT, etc.) speculation, unless it is purely informative and not too cringe
- 7. Absolutely no tech bro shit. If you have a good opinion of Silicon Valley billionaires please manifest yourself so we can ban you.
founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
The "blessed user defaults" theme is long overdue. Emacs blows all its competitors out the water but the on ramp to Emacs is a tar pit.
A lot of emacsims are being ironed out and tree-sitter modes are looking great. It might make me decide to try fully vanilla emacs again (before using magit again).
Yeah, I'm tempted to steal a baseline from https://github.com/LionyxML/emacs-solo and see if I can be convinced to break a decade-long Evil habit. Tree-sitter modes are awesome (daily driving the pgtk branch for as long as that's been possible), and I have not considered going back to lsp-mode since eglot was absorbed into Emacs proper.
Really good video about the changes to speedbar mode that’s inline with the emacs solo default usage philosophy: Prot on speedbar
Something about tree-sitter I need to tell someone:
I have found (when I tried it last year) that for C (and C++ I presume), the existence of the preprocessor causes tree-sitter-mode serious problems. Using such common macros as
#define list_for_each(...) for (...)or#define _unused_ __attribute__((unused))makes it shit the bed. It treatslist_for_eachas a function and gets confused that it is followed by{...}, which is especially annoying as it then insists on indenting it incorrectly. Something like_unused_can screw up the declaration parser and it can no longer figure out what the identifier is that's being declared. Also writing multi-line macros is a pain because when it auto-indents it fucks up my manual indentation, because it has no understanding of the thing; I suspect it doesn't attempt to parse macro bodies at all. You could probably disable auto-indent somehow for the whole mode, but I do want it to do that when it does it correctly.Why doesn't someone fix this you may ask? Well...
In order to parse C macros properly and correctly, you'd need to run the code through a cpp of some kind before handing it over to tree-sitter. That would of course mean it has to parse the headers also, and in order to find the headers reliably it would need to be told the compiler flags. It would also need to be able to map file positions back to its original non-preprocessed sources. Also imagine it having to go through approximately one billion lines of C++ templates for every STL include.
Doing all this seems hard, so I can see why they don't do that, but unfortunately it's worse than cc-mode right now (or rather last year when I tried it), which kind of muddles through all this stuff.
Maybe tree-sitter-mode could muddle through also somehow? Maybe by modifying the grammar, one could alter how exactly it misparses code involving such macros and then at least it would get the indentation correct. Also possibly one could do a mode on top of tree-sitter-mode that overrides the indentation stuff but keeps tree-sitter-mode's syntax highlighting, which can be incorrect in the face of macros, but is overall more sophisticated than cc-mode's.