Skip to content

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