Discussion:
[emms-help] Use define-*-mode facility? (emms-browser-mode-hook is missing)
Pierre Neidhardt
2017-12-14 08:19:13 UTC
Permalink
I was wondering why EMMS does not use the `define-*-mode` macros.
Commands, variables, hooks and maps are defined manually. Any reason for
that?

This leads to inconsistencies. For instance `emms-browser-mode` does not
have a mode hook. I would like to add one, I think it's an essential
feature.
Alex Vong
2017-12-14 09:26:10 UTC
Permalink
Post by Pierre Neidhardt
I was wondering why EMMS does not use the `define-*-mode` macros.
Commands, variables, hooks and maps are defined manually. Any reason for that?
I would guess the reason is historical.
Post by Pierre Neidhardt
This leads to inconsistencies. For instance `emms-browser-mode` does not have a mode
hook. I would like to add one, I think it's an essential feature.
_______________________________________________
Emms-help mailing list
https://lists.gnu.org/mailman/listinfo/emms-help
Yoni Rabkin
2017-12-14 12:19:12 UTC
Permalink
Post by Pierre Neidhardt
I was wondering why EMMS does not use the `define-*-mode` macros.
Commands, variables, hooks and maps are defined manually.  Any reason
for that?
The recommendation to use define-derivative-mode and such was added in
2011, and most of the mode-related code in Emms was written a long time
before that.

That's pretty much the entire reason; just history.
Post by Pierre Neidhardt
This leads to inconsistencies.  For instance `emms-browser-mode` does
not have a mode hook.  I would like to add one, I think it's an
essential feature.
You can add standard hooks wherever you see that one is missing, since
merely adding a hook can't break any code.

However, you would need to be more careful if you wanted to convert
existing modes to be defined via define-*-mode, for obvious reasons, to
make sure nothing mysteriously breaks.
--
"Cut your own wood and it will warm you twice"
Loading...