Skip to content
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

Add ocamlformat for emacs setup #48

Merged
merged 2 commits into from
Mar 21, 2023

Conversation

sangwoo-joh
Copy link
Contributor

Hi.

I've added some implementations to integrate ocamlformat into Emacs setup (#40)
I only added this to Emacs setup just because my primary editor is Emacs.
It binds C-c C-f to call ocamlformat for the current buffer.

Please review this pull request.
Thank you.

@rjbou
Copy link
Collaborator

rjbou commented Mar 4, 2020

Thanks for the PR! as a vim user, i'll ping @AltGr for this one

@jberdine
Copy link

I wonder whether this should consider also setting (add-hook 'before-save-hook 'ocamlformat-before-save)?

I'm also not sure if there is a standard key binding that most use. For one data point, I shadow the keys tuareg-indent-phrase to invoke ocamlformat, so M-q and C-c C-q.

It is also not completely obvious in which mode map to put these bindings. Is it ok to hijack tuareg-mode-map with not-so-related bindings?

@sangwoo-joh
Copy link
Contributor Author

@jberdine Thanks for your comment.
Regarding (add-hook 'before-save-hook 'ocamlformat-before-save), I think it should also consider the setting.
Regarding key bindings, I'm also not sure if there is a dominant key biding standard. I'm wondering if there is a way to get a key binding from user input.
Regarding hijacking, I just added it to tuareg-mode-map because it was the way I've used for a long time. If there is a better way to do this, please let me know.
Thank you.

@punchagan
Copy link

@rjbou @AltGr This PR seems reasonable to me. What does it need to get merged? Is it waiting on adding support to ocamlformat to the other editors as well?

I have some time in the next couple of days, if there's any thing I can do to help. :)

@AltGr
Copy link
Contributor

AltGr commented Mar 21, 2023

Oh I am sorry this completely passed under my radar. Thanks for the contribution, and this seems good to me!

@AltGr AltGr merged commit cfc575f into ocaml-opam:master Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants