-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 coq layer #6911
Add coq layer #6911
Conversation
afd5d58
to
658168f
Compare
Thanks for this! ❤️ In regards to Proof General, since they are hosted on a git repository we are be able to use the MELPA github fetcher to grab their package. Additionally I believe compilation for Proof General only involves optionally byte compiling the elisp files, so the package should be usable even without running Normally it would be trivial to fetch and compile an elisp package from github but unfortunately Proof General doesn't follow the MELPA package format yet so hacking around it would be running into the same problem as #2880 😟 . Luckily, there has been recent activity in trying to port the package into MELPA format melpa/melpa#3454. The current workaround seems fine 😄, with my only suggestion being that a small note should be added stating that the I love the use of the new Proof General mascot for the layer logo 😄 , could you possibly resize it so its height is below 200 pixels whilst maintaining the aspect ratio such that it conforms with spacemacs conventions? Considering the amount of issues spacemacs gets related to incompatible fonts I've gone ahead and added an FAQ entry about disabling symbol prettification to the README. I've also disabled the welcoming message that company-coq gives you when opening a coq file and added a note to the docs about manually invoking the tutorial. Lastly, I have diminished a few more useless modes that simply clutter the mode-line and updated a couple of small things in the layer so it's more inline with spacemacs conventions. The patch can be found here. Thanks again for submitting this! ❤️ |
20b0496
to
668a97a
Compare
@NJBS Thanks very much for you detailed suggestions! I've merged your changes and resized the image :) |
c8fe26f
to
5d57cf2
Compare
@syl20bnr ping the boss |
Looks like this isn't really progressing. @NJBS maybe you could lend them a hand? |
@syl20bnr @bixuanzju Is there anything stopping this PR? |
I like this layer quite a lot, thanks! One problem I found is that interacts badly with the new purpose stuff. Both When I don't know whether this can be solved by configuring |
The following fixes the interaction with window-purpose, as suggested by @bmag in the discussion after this comment
|
@aroig Thank you! I was curious why I don't have such problem as you described, until I found I have some similar config in my
|
@syl20bnr any plan when this can be merged? Thanks! |
@bixuanzju Have you tried to use the github fetcher instead of relying on the user to have already downloaded and compiled (proof-general :location (recipe
:fetcher github
:repo "ProofGeneral/PG"
:files ("*"))) Only issue here would be you still need to add at least Another option would be to define two packages like: ;; note that the name of the provided feature by generic/ is 'proof not 'proof-general
(proof :location (recipe
:fetcher github
:repo "ProofGeneral/PG"
:files ("generic/*.el" "lib/*.el")))
(coq :location (recipe
:fetcher github
:repo "ProofGeneral/PG"
:files ("coq/*.el"))) then compilation would be automatic and you would not to have to mess with the loadpath. Thanks for all your effort on this layer :) |
I would love to have this in spacemacs as well. |
@vic Thanks! I adapted your first approach. Now the layer seems more robust. |
I like this layer too. this is useful. |
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.
BTW, yesterday I just had time to install this layer, and coq-mode worked fine.
Only issue was, after adding the coq
layer to my spacemacs and reloading, lots of compiler warning/errors were displayed on the compilation buffer, it turned my emacs unusable (could not even change to other buffer), but after restarting emacs everything was working again (including the coq mode), so I don't know if this is related to the elisp installed by this packages or if it was something wrong with spacemacs itself.
layers/+lang/coq/packages.el
Outdated
:defer t | ||
:init | ||
(progn | ||
(setq coq/proof-general-load-path (concat (spacemacs//get-package-directory 'proof-general) "generic")) |
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.
Haven't tested the layer with this, but as far as I remember, you'd have to add generic
, lib
and coq
subdirectories as well, not really sure, does having just generic
works for you?
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.
Oh yes, I've used it for some time without any problems.
just for the record, here's the list of errors/warnings when fresh-installing this layer. https://gist.github.com/vic/e30b8bf2579e8b93a25c69e59abf3243 as I said previously, once emacs is restarted everything seems to work ok. |
@vic I've checked again the official site of PG (https://github.com/ProofGeneral/PG), it says users only need to add the following:
So I think adding |
33431f5
to
432e994
Compare
0b9251e
to
1c218b1
Compare
Seems to work great except for company-coq:
|
@rgrinberg This is probably related to incompatibility between company-coq and Coq v8.6. cpitclaudel/company-coq#126 |
I can reproduce both the warnings and the For other folks who want to use this while it's unmerged:
then just enable the |
@siddharthist: |
@bixuanzju Please apply the following patch:
|
@rgrinberg Thanks! I've already have had this change in my local machine. |
Works quite nicely mostly. I have some trouble with opening buffers. If somehow the coq goal window has been closed then opening coq new coq files/window-move commands will make the file buffer dissapear. Another problem I'm observing is that when I use this on a emacs daemon instance, it tends to "crash", i.e. the client closes regularly. Haven't investigated yet into what exactly happens. |
@syl20bnr Would you having a look at this? coq is a pretty important programming language and having a layer for it would be very useful for everyone. The layer itself has already been tested by me and other people in this thread so it seems to be ready for prime time. |
Yep I will merge it soon, I'm focusing on the language layers. Recently I need to work on a java project for work so I'm into this language layer for now, but I'll try to check coq this week-end 👀 |
Thank you ! 💜 ❗️ Watch out I made some changes to the key bindings to better fit the whole Spacemacs experience (still subjective though :-D), read carefully the commit message: fe168f0 I would prefer to have I hope the key bindings changes won't be too much controversial, they have almost all a raison d'être. For instance the capital for Cherry-picked into develop branch, you can safely delete your branch. |
See also commit 8f1a5d6 where I cleaned up a bit the configuration. Forgot to close this PR, closing it now :-) |
@syl20bnr Many thanks! |
Thanks everyone for all the work on this! Plenty of exciting stuff in there, and I'm glad to see there's now an official Spacemacs layer for Coq (context: I wrote company-coq, and I co-maintain PG). Some questions and nitpicks (apologies if any of this is obvious: I don't use Spacemacs myself):
Thanks for the cool work on this! Hopefully we can put PG in MELPA soon, and then update this layer to depend on PG instead of fetching it from Github :) Clément. (btw, is there a way for me to follow updates to this without following all Spacemacs updates? I only found out about it through the link to a now-fixed company-coq issue) |
I'll address the things that I can:
* Could any of the Spacemacs bindings be added to Proof General/Company-Coq directly? I don't use evil-mode myself, but I understand that there are people that use it without using spacemacs. Wouldn't they benefit from these keybindings being in PG directly?
I'm not sure what you mean here. All the original proof general/company coq
bindings are still available directly.
- `(company-coq :toggle (configuration-layer/package-usedp 'company))`: I don't know if I understand this right, but company-coq has a lot more than company-mode backends; does this code mean that company-coq won't be enabled if company isn't?
That's correct. Is company-coq useful for auto-complete users for example? If
that's the case it would be good to improve the layer to help users that don't
use company.
(btw, is there a way for me to follow updates to this without following all Spacemacs updates? I only found out about it through the link to a now-fixed company-coq issue)
I don't think there's a way. But I would welcome you being cc'd on any changes
to the coq layer.
|
The completion parts are company-specific, but company-coq does a lot more than completion (mainly prettification, subscripts, jumping to a definition, documentation, highlighting special comments, code folding, notifications, refactoring "require"s, notifications, etc.). All of these are available independently of company. The name of the package is a bit of a historical accident :)
Sorry for being unclear. I meant to ask whether I should merge part of the spacemacs keybindings to improve the experience of non-spacemacs evil users. |
Thanks for the work everyone! In case you're interested, I created issue #8450 to discuss configuration in this layer. I'd appreciate your feedback, especially if you use Coq! |
I've been using this layer for quite a time now, maybe it's time to share with everyone!
Proof General
is an indispensable tool for programming in Coq,but it is not on MELPA, so I am not sure what is the appropriate way to instruct users to download and install it. For now, I assume it is installed under.~/.emacs.d/private
(see theInstall
section in README)Suggestions are welcome!
PS: calling @NJBS for help and test :)
Edit:
Thanks due to @vic, now we use quelpa to help fetch the source of proof-general and install.