Skip to content

forward-sexp works poorly with operator names #648

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

Closed
ikirill opened this issue May 13, 2015 · 1 comment
Closed

forward-sexp works poorly with operator names #648

ikirill opened this issue May 13, 2015 · 1 comment

Comments

@ikirill
Copy link
Contributor

ikirill commented May 13, 2015

In the following line

x Array.! y

place point before x and then use mark-sexp. The marked strings will be:

x
x Array.
x Array.! y

This is not correct behaviour for haskell-mode, because x Array. is not a meaningful haskell expression while x Array.! would be (in the sense of an operator slice, at least): this breaks navigation of haskell code by other emacs tools that rely on standard emacs functions such as forward-sexp.

As a possibility, haskell-mode could potentially provide its own forward-sexp-function that marks expressions suitable to haskell.

Also related is that haskell-ident-at-pos returns either Array, or Array., depending on where point is placed within Array.!, which is probably why documentation for Array.! is not displayed when point is on top of it. (The command given to ghci in process log is :info Array., which is wrong.) Ideally, after placing point on Array.!, eldoc-mode (or haskell-doc-mode) should show information about the operator Array.!.

@gracjan
Copy link
Contributor

gracjan commented May 25, 2015

Interesting.

forward-sexp-function is not implemented, although there are traces in the comments that previous civilization had implemented haskell-doc-forward-sexp-safe. That got removed, as comments say, in Revision 1.6 2004/10/13 22:45:22 monnier.

haskell-ident-at-pos (and related thing-at-pos 'sexp) are a different matter.

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