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 configuration for Coq #1007

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

tchajed
Copy link
Contributor

@tchajed tchajed commented Feb 20, 2020

This is somewhat magical to me but it's copied from Doom Emacs' configuration for OCaml (tuareg-mode) and F# and it seems to work nicely: https://github.com/hlissner/doom-emacs/blob/1ab9f8b99d35a451a06c8278457ddfa58c566186/modules/config/default/config.el#L182.

I also tried (sp-local-pair "(*" "*)") but with that if you type (* you get (**)). It's quite possible that smartparens has this bug currently for OCaml and F#.

@Fuco1
Copy link
Owner

Fuco1 commented Feb 29, 2020

Is Coq in any way related to ML? I used it a couple years ago but as far as I remember it's a completely different thing. So probably a separate config file would be better? Or does it share some setup.

(sp-with-modes '(coq-mode)
;; Disable ` because it is used in implicit generalization
(sp-local-pair "`" nil :actions nil)
(sp-local-pair "(*" "*)" :actions nil)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to also add:

;; Disable ' because it is used in pattern-matching
(sp-local-pair "'" nil :actions nil)

(sp-local-pair "(*" "*)" :actions nil)
(sp-local-pair "(*" "*"
:actions '(insert)
:post-handlers '(("| " "SPC") ("|\n[i]*)[d-2]" "RET"))) )

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a tiny DSL which can specify certain actions to be performed after the pair was inserted and another command was triggered. See https://github.com/Fuco1/smartparens/wiki/Permissions#insertion-specification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

None yet

3 participants