Description
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.