-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make elixir-ts-mode-hook a customizable variable #37
Conversation
@sirikid what problem are you trying to solve here? I have not seen this done on other modes and not sure what it achieves. |
Language mode hooks are intended for user customization thus they should be accessible through Custom. I think most of the built-in hooks are customizable at this point. |
@sirikid there is already a elixir-ts-mode hook which is part of deriving from prog-mode. what am I missing here? You can already do something like this:
|
I had a look at some other modes and saw lua-ts-mode is the only -ts-mode with this variable. Let me do some reason to see how it works. If you can give me an example it would also be great. |
Custom is an Emacs subsystem for interactive customization. Here you can see my On the left is the customization of the hook and on the right is the customization of another variable with a relatively complex structure (alist). |
I am guessing the proposed change allows you to use the customize menu instead of having to do it in your init.el file? Not many modes have this, so just trying to understand. The PR came with no motivation or description. |
Yes.
I had a different experience.
Sorry, I thought it was a common knowledge. |
You can view the emacs source code and will find it is in only a handful of progmodes.
Even so, its still good to give some motivation. I can't see a reason not to add it after having a look. Please add an appropriate comment as below then I can merge: (defcustom c-mode-hook nil
"Hook called by `c-mode'."
:type 'hook
:group 'c) You don't need the comment either. |
f7ddae8
to
d584941
Compare
d584941
to
1ffd6e1
Compare
@@ -613,6 +613,12 @@ Return nil if NODE is not a defun node or doesn't have a name." | |||
(save-excursion | |||
(newline 1 t)))) | |||
|
|||
(defcustom elixir-ts-mode-hook '() | |||
"Hook run after entering Elixir mode." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Hook run after entering `elixir-ts-mode'." its not Elixir mode.
@@ -613,6 +613,12 @@ Return nil if NODE is not a defun node or doesn't have a name." | |||
(save-excursion | |||
(newline 1 t)))) | |||
|
|||
(defcustom elixir-ts-mode-hook '() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The convention is to specify 'nil' here. Even though its the same it is still good to stick with conventions.
"Hook run after entering Elixir mode." | ||
:group 'elixir-ts | ||
:type 'hook | ||
:options (list #'eglot-ensure)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the form '(eglot-ensure) as this seems to be the convention.
No description provided.