Skip to content

Going forward defun should go to end of defun #1335

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

Merged
merged 1 commit into from
May 31, 2016
Merged

Going forward defun should go to end of defun #1335

merged 1 commit into from
May 31, 2016

Conversation

czipperz
Copy link
Contributor

In other emacs modes, C-M-e will go just past the end of the current function rather than to the beginning of the next function. Here is a patch that makes this work correctly for haskell-decl-scan-mode.

@gracjan
Copy link
Contributor

gracjan commented May 21, 2016

Reference #624.

@czipperz: Can you add some tests for this behavior? Thanks.

@czipperz
Copy link
Contributor Author

I wrote some tests and fixed some bugs. I refactored out this out to haskell-ds-forward-decl as I think it should only affect when (end-of-defun) is used. The only problem with this new code is that if the cursor is on a line before the first non-blank line (ie file is "\nmodule File where\n..."), then it has the old behavior.

@czipperz
Copy link
Contributor Author

czipperz commented May 22, 2016

@gracjan Done. These should be squashed since they are fixup commits.

@gracjan
Copy link
Contributor

gracjan commented May 22, 2016

Instead of hardcoded position I would prefer checks based on looking-at-p after the move.

Can you also squash and force-push to this pr? Thanks.

@czipperz
Copy link
Contributor Author

That's smart will do tomorrow

@czipperz
Copy link
Contributor Author

I put you as the copyright holder for this code. Is this required for contribution or should I put myself down?

@gracjan
Copy link
Contributor

gracjan commented May 22, 2016

Copyright: Haskell mode Contributors
Author: You

@czipperz
Copy link
Contributor Author

Fixed build error if (< (emacs-version) 24.4)

@@ -0,0 +1,97 @@
;;; haskell-decl-scan-tests.el -*- lexical-binding t -*-
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a colon between lexical-binding and t.

@czipperz
Copy link
Contributor Author

Did that. What does that do?

@gracjan gracjan merged commit dc775d5 into haskell:master May 31, 2016
@czipperz
Copy link
Contributor Author

Read it on Wikipedia nvm

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