-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
New erlang (treesitter) mode #9322
base: master
Are you sure you want to change the base?
Conversation
Thanks for this. Quick first pass - ⸺
It's probably a good idea to add a version, and I see you commented:
and I see from your code that this is "So the menus (and functions) work as expected". I think yours is the only ts package I've seen that had this requirement, and I usually try to be pretty intolerant about people dipping their toes outside their namespaces - even a closely related one like this. Could you describe what's going on that's causing the functions (which?) to work unexpectedly? |
Hmm, ok, maintaining the "old" erlang mode for 15 years, and there the version have been updated,
I don't have time to completely re-write all the functionality from the old mode in the new erlang-ts mode now, So erlang-ts mode (currently) loads and re-uses the old erlang mode for everything except syntax-highlighting which The old erlang mode installs menus where the user can change syntax-highlighting level, those menu entries call I'm not emacs-lisp guy, just a user and the unlucky guy in the maintaining lottery :-) |
That's fair - I think some people even just leave it at version 0.0. My only (weak) counter would be that I guess people sometimes find elisp files lurking on wikis and old archives, and in that case seeing the versions could be interesting (if not that useful). I would recommend avoiding
I understand the time constraint (and thank you, btw, for your maintainership). I think a better pattern would be to create advice functions inside your namespace: (defun erlang-ts--font-lock-level-1 (func &rest args)
"To be used as :around advice."
(if erlang-ts-mode
(erlang-ts-set-font-lock-level 1)
(apply func args))) Then, the first time your mode is toggled on, you could run: (advice-add #'erlang-font-lock-level-1 :around #'erlang-ts--font-lock-level-1) (this is idempotent so it's okay if it gets called repeatedly) Finally, I'd recommend you add a (advice-remove #'erlang-font-lock-level-1 #'erlang-ts--font-lock-level-1) |
I have added (and tagged) a version 0.1 last week, I will test your other suggestion next week, need to read up emacs-lisp a bit. Thanks for taking time and making suggestions of how to solve it. |
To be able to get rid of all warnings I had to do:
And I also added a unload function
And things seems to work as expected. |
Thanks! Here's the latest (maybe your default branch wasn't updated? Also I want to emphasize that the version-regexp is probably not required). ⸺
⸺
⸺ Package and license:
|
Check again, I had pushed to my "private" repo and not the official/upstream one, sigh. Pushed it to upstream now.
What does that mean, that you want use the github tag?
I will tag the release when you are happy :-) |
Your recipe is (erlang-ts
:fetcher github
:repo "erlang/emacs-erlang-ts"
:version-regexp "v%v") but |
396ad2d
to
feb757e
Compare
Brief summary of what the package does
New erlang (treesitter) mode
Currently only fixes font-locking and relies on the "old" erlang mode for everything else.
Direct link to the package repository
https://github.com/erlang/emacs-erlang-ts
Your association with the package
maintainer, author
Relevant communications with the upstream package maintainer
None needed
Checklist
M-x checkdoc
to check the package's documentation strings** package-lint reports errors for function names but they are intentionally there for overriding the
the erlang mode functions.