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

Clean up SCC code #986

Merged
merged 8 commits into from
Nov 20, 2015
Merged

Clean up SCC code #986

merged 8 commits into from
Nov 20, 2015

Conversation

bergey
Copy link
Contributor

@bergey bergey commented Nov 11, 2015

Following discussion at #961, I've tried to make the SCC functions (which I use) more pleasant to use and to maintain. Please let me know if you want things done differently.

I wrote a new function to toggle SCC's, so only one keybinding is necessary. I refactored the existing code to avoid spurious errors about "can't remove SCC" when adding an SCC. I kept the old functions around for backwards compatibility, but I don't really care if they go away.

Along the way I found a bug, which I think I've fixed and adequately described in the commit messages.

If point is on the second character of a word,
haskell-mode-try-scc-at-point will break the word, inserting an SCC
annotation between the first and second characters.
Don't insert SCC if the character before point is the beginning of a
word.  Do insert SCC if the character at point is not the beginning of a
word, but the character before point is whitespace.  This occurs when
the character at point is a non-letter, such as = or {.
@gracjan
Copy link
Contributor

gracjan commented Nov 11, 2015

This is really good!

Please use make-obsolete for the functions that are no longer useful, we will remove them a couple of releases from now.

@bergey
Copy link
Contributor Author

bergey commented Nov 11, 2015

Thanks for pointing out make-obsolete. I didn't know how to do that in elisp.

@bergey
Copy link
Contributor Author

bergey commented Nov 11, 2015

Ah, whoops, I didn't realize the third argument to make-obsolete is mandatory. Maybe this will pass CI.

gracjan added a commit that referenced this pull request Nov 20, 2015
@gracjan gracjan merged commit e589a79 into haskell:master Nov 20, 2015
@gracjan
Copy link
Contributor

gracjan commented Nov 20, 2015

We will see if there is anybody bitching about C-c C-s taken for something else :)

@bergey bergey mentioned this pull request Nov 25, 2015
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.

2 participants