Skip to content

[Fix 489] Inserting parens before comment form doesn't move point #490

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

Conversation

dpsutton
Copy link
Contributor

#489

In a form like

|

(comment
(stuff))

Entering parens with paredit would put the parens right before the comment
block. Paredit determines if it is in a comment to insert parens so it doesn't
automatically enter a closing when in a comment or a string. Part of this called
beginning-of-defun which we have modified.

The error here was that rater than just going to the beginning of the form, we
went to the end and then back one logical form to be at the beginning. This is
identical behavior unless you are between two forms. Going straight to the
beginning put you in the first form, going to the end and then the beginning
puts you in the second form. I.e.,

(formA)
|
(formB)

Our beginning of form went to formB but it should go to formA.

Replace this placeholder text with a summary of the changes in your PR.


Before submitting a PR mark the checkboxes for the items you've done (if you
think a checkbox does not apply, then leave it unchecked):

  • The commits are consistent with our contribution guidelines.
  • You've added tests (if possible) to cover your change(s). Bugfix, indentation, and font-lock tests are extremely important!
  • You've run M-x checkdoc and fixed any warnings in the code you've written.
  • You've updated the changelog (if adding/changing user-visible functionality).
  • You've updated the readme (if adding/changing user-visible functionality).

Thanks!

In a form like

|

(comment
   (stuff))

Entering parens with paredit would put the parens right before the comment
block. Paredit determines if it is in a comment to insert parens so it doesn't
automatically enter a closing when in a comment or a string. Part of this called
beginning-of-defun which we have modified.

The error here was that rater than just going to the beginning of the form, we
went to the end and then back one logical form to be at the beginning. This is
identical behavior _unless_ you are between two forms. Going straight to the
beginning put you in the first form, going to the end and then the beginning
puts you in the second form. I.e.,

(formA)
|
(formB)

Our beginning of form went to formB but it should go to formA.
@dpsutton
Copy link
Contributor Author

dpsutton commented Oct 1, 2018

@bbatsov ping :)

@bbatsov bbatsov merged commit 16a889a into clojure-emacs:master Oct 1, 2018
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