Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

Elisp bugfix/docs #836

Merged
merged 3 commits into from
Oct 2, 2016
Merged

Elisp bugfix/docs #836

merged 3 commits into from
Oct 2, 2016

Conversation

simonjwinwood
Copy link

Nothing too exciting, although using ad-advice-activate doesn't seem to work for me, while using after-save-hook does.

@DanielG
Copy link
Owner

DanielG commented Oct 2, 2016

I didn't realize anyone other than me was using this branch :)

I've been having problems with the after-save advice as well recently and switched to the hook too, just haven't committed that yet.

The problem with after-save-hook is that it only runs if the buffer was actually saved, so if nothing is modified it doesn't run check again which can be annoying with the new jump-to-error stuff. So eventually I'd like to investigate why the advice isn't working when it used to.

@DanielG DanielG merged commit 7c767b5 into DanielG:dev-elisp Oct 2, 2016
@DanielG
Copy link
Owner

DanielG commented Oct 2, 2016

One minor difference to my local version is that I add the hook buffer-locally and then don't bother checking if haskell-mode is t. I think with your version making the hook buffer local anyways might be a good idea too? Not sure though.

@simonjwinwood
Copy link
Author

I was thinking of writing the minor-mode stuff myself, and then noticed the elisp branch. With the hook stuff, I imagine that the case where you have made no changes but still want ghc to run would be pretty rare, maybe just add a binding for ghc-reload or whatever it is called. The only reason I didn't add the hook locally is that after-save-hook is marked as risky (although I notice haskell-mode makes it local anyway) --- having it be local makes more sense to me apart from that.

Do you have any other TODOs? I use ghc-mod in Emacs a fair bit, so I am happy to help.

@DanielG
Copy link
Owner

DanielG commented Oct 2, 2016

I dunno I do use jump-to-error quite a bit and wanting to jump back to the first error location does come up. I'll see if I can get the advice to work again at some point before this gets released, I mean it's been working for like 4+ year or something so .. ;)

As far as TODOs go yeah lots, the elisp is pretty neglected and really needs a good cleanup. Some immediatley useful things I can think of is removing legacy uses of ghc-* overlay properties (other than ghc-info): https://github.com/DanielG/ghc-mod/blob/dev-elisp/elisp/ghc-check.el#L212

Those used to be useful because Kazu decided to use defstruct for the info structure but I'm using pcase-let now to make that easier. Part of my ongoing mission to make ghc-mod's elipsp bits feel a bit more haskelly. Anyways you should be able to find all the relevant references by looking for overlay-get.

Then there is rewriting/extending ghc-with-process to support the unmap-file ghc-mod command which would probably get rid of such nasty bugs as #609 and maybe #652 but that probably needs a lot of prior discussion.

Speaking of which if you want to you should hang out in #ghc-mod which is where I can usually be found for discussions too tangential for a GH issue.

Other than that the component: elisp label is useful, for example #705 might be easy to do (thought I don't remember the exact quoting rules we ended up with off hand).

Lots to do in Elisp land in any case.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants