Closed ilohmar closed 1 year ago
Thank for raising this issue! I didn't realize it affected a global hook. This definitely needs to change. Out of your two proposed solutions, which one would you prefer?
The wording probably already gave away my preference ;). I would strongly prefer just a note in the README (and removing the code) --- it's simply less code to maintain, and a dedicated mode for zig compilation might easily create its own issues down the road. If you want, I can prepare a PR this weekend.
If you want, I can prepare a PR this weekend.
That would be great, thanks!
Hi @joachimschmidt557, is there anything else I can do to move this PR forward?
Sorry for the delay. Thanks!
I have recently re-started enjoying zig, and I am using Emacs. I noticed that
zig-mode
adds coloring functions to the (global!)compilation-filter-hook
.This affects all compilation output, ie, all other languages, and even derived modes like
grep-mode
and many more.Therefore, this kind of thing is usually considered overly intrusive for a major-mode. Would you consider removing the code which does that? I'm talking about https://github.com/ziglang/zig-mode/blob/dbc648f5bca8f3b9ca2cc7827f326f5530115144/zig-mode.el#L556 ff. at the end of the file.
If users want that, they usually already have it enabled voluntarily; a note in the documentation might alert them to the possibility. If you feel strongly about it, one proper way to force the colorization on users would be to use an additional zig-specific compilation-mode.