ziglang / zig-mode

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

customize-mode compatibility #36

Open lolbinarycat opened 3 years ago

lolbinarycat commented 3 years ago

I typed customize-mode to add something to the hook, only to find that there wasn't one. Is there something I'm missing?

bbuccianti commented 3 years ago

I think would be useful to have a hook too. Would be trivial to add one like zig-mode-hook. If folks think this is doable, I can make a PR for that.

jcs090218 commented 5 months ago

zig-mode is using the standard define-derived-mode. The mode hook should be defined already. 🤔

lolbinarycat commented 5 months ago

if i had to guess it exists but isn't visible to custom.

jcs090218 commented 5 months ago

What package management tool do you use to install packages? package.el? 🤔

lolbinarycat commented 5 months ago

yes.

it seems customize-mode is actually broken with a lot of non-core modes, i believe you need to add :group 'zig-mode to the mode definition.

jcs090218 commented 5 months ago

I believed is there for a long time, see

https://github.com/ziglang/zig-mode/blob/9ce200971008fa29641ab7bec80802b450b65646/zig-mode.el#L494

Apparently, customize mode can't work with unloaded module. Therefore, you have to (require 'zig-mode) before customize-mode.