haskell / haskell-mode

Emacs mode for Haskell
http://haskell.github.io/haskell-mode/
GNU General Public License v3.0
1.33k stars 342 forks source link

beginning-of-defun-function and end-of-defun-function go too far #624

Open gracjan opened 9 years ago

gracjan commented 9 years ago

beginning-of-defun-function should put cursor in column 0 where the definition begins (currently it puts it at the end of line the line before).

end-of-defun-function should put cursor in column 0 after last line of the definition (currently it can go many empty lines below it).

gracjan commented 8 years ago

And those two functions are active only when haskell-decl-scan-mode is active so referencing #623 seems in order. Those should work in plain haskell-mode.

gracjan commented 8 years ago

Related: #1122.

gracjan commented 8 years ago

beginning-of-defun-function should be same functionality as in haskell-indentation-mode, so it is part of common functionality.

gracjan commented 8 years ago

Spec:

gracjan commented 8 years ago

beginning-of-defun is implemented in haskell-indentation-mode as haskell-indentation-goto-least-indentation. This should be put up higher level, presumably in haskell-mode.

gracjan commented 8 years ago

And take those two functions out of haskell-decl-scan.

czipperz commented 7 years ago

I believe this is already working?

czipperz commented 7 years ago

On a semi-related issue, I made haskell-ds-backward-decl and haskell-ds-forward-decl work correctly with operators. Is it OK to bind these to C-M-a and C-M-e, as they implement that functionality correctly, but the beginning-of-defun and end-of-defun functions don't work correctly with it.

gracjan commented 7 years ago

The point is to make those functions available without enabling haskell-decl-scan-mode.