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

haskell-forward-sexp should signal scan-error at the end of list like forward-sexp #1148

Closed
cruegge opened this issue Feb 11, 2016 · 4 comments

Comments

@cruegge
Copy link
Contributor

cruegge commented Feb 11, 2016

Emacs' own forward-sexp does not jump out of balanced expressions. Instead, it signals a scan-error. This behaviour is used by functions like up-list to determine the end of the expression. haskell-forward-sexp, on the other hand, jumps out of the expression without error. While this behaviour is probably more intuitive from the user perspective, it breaks at least one other useful navigation function.

I assume that implementing the proper behaviour for arbitrary Haskell expressions would be way to complex, but maybe it would be possible to simply signal an error when looking at a closing paren/bracket/brace, thus retaining the most common use-case for up-list, i.e. jumping out of sexp-like lists. Another option might be to just rebind forward-sexp instead of setting forward-sexp-function to a function that does not behave properly.

@gracjan gracjan changed the title haskell-forward-sexp as forward-sexp-function breaks up-list haskell-forward-sexp should signal scan-error at the end of list like forward-sexp Feb 11, 2016
@gracjan
Copy link
Contributor

gracjan commented Feb 11, 2016

Agreed. @cruegge: can you add a failing test case for this?

@cruegge
Copy link
Contributor Author

cruegge commented Feb 11, 2016

Never did this, but I think I'll figure it out. Might take a while.

@gracjan
Copy link
Contributor

gracjan commented Feb 11, 2016

@gracjan
Copy link
Contributor

gracjan commented Feb 13, 2016

Fixed by #1151.

@gracjan gracjan closed this as completed Feb 13, 2016
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

No branches or pull requests

2 participants