ziglang / zig-mode

Zig mode for Emacs
GNU General Public License v3.0
157 stars 54 forks source link

`zig-mode` changes global `compilation-filter-hook` #76

Closed ilohmar closed 1 year ago

ilohmar commented 1 year ago

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.

joachimschmidt557 commented 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?

ilohmar commented 1 year ago

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.

joachimschmidt557 commented 1 year ago

If you want, I can prepare a PR this weekend.

That would be great, thanks!

ilohmar commented 1 year ago

Hi @joachimschmidt557, is there anything else I can do to move this PR forward?

joachimschmidt557 commented 1 year ago

Sorry for the delay. Thanks!