Skip to content

[Fix #429] Last occurrence sometimes not replaced for move-to-let #430

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
Apr 7, 2017

Conversation

benedekfazekas
Copy link
Member

@benedekfazekas benedekfazekas commented Apr 7, 2017

In case

  • there are more than one occurrences of expression
  • and move to let is not initiated from the last occurrence
  • and actual bound name is longer than the expression being moved to let
    the last expression won't be replaced.

Fix: end of let expression is not cached before calling clojure--replace-sexps-with-binding.

Replace this placeholder text with a summary of the changes in your PR.
The more detailed you are, the better.


Before submitting a PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):

  • The commits are consistent with our contribution guidelines
  • You've added tests (if possible) to cover your change(s). Indentation & font-lock tests are extremely important!
  • All tests are passing (make test)
  • The new code is not generating bytecode or M-x checkdoc warnings
  • You've updated the changelog (if adding/changing user-visible functionality)
  • You've updated the readme (if adding/changing user-visible functionality)

Thanks!

CHANGELOG.md Outdated
@@ -4,6 +4,7 @@

### Bugs fixed

* [#429](https://github.com/clojure-emacs/clojure-mode/issues/429): Fix last occurrence of expression sometimes is not replaced when using `move-to-let`.
Copy link
Member

Choose a reason for hiding this comment

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

This sentence sounds a bit strange to me. :-) Perhaps "Fix a bug causing the last..."?

In case
* there are more than one occurrences of expression
* and move to let is not initiated from the last occurrence
* and actual bound name is longer than the expression being moved to let
the last expression won't be replaced.

Fix: end of `let` expression is not cached before calling `clojure--replace-sexps-with-binding`.
@bbatsov bbatsov merged commit 2d67af4 into master Apr 7, 2017
@bbatsov bbatsov deleted the fix-429 branch April 7, 2017 10:12
slipset pushed a commit to slipset/clojure-mode that referenced this pull request Nov 1, 2017
…ove-to-let` (clojure-emacs#430)

In the following case:

* there are more than one occurrences of an expression
* and `move-to-let` is not initiated from the last occurrence
* and the actual bound name is longer than the expression being moved to `let`

the last expression won't be replaced.

The solution: the end of the `let` expression is not cached before calling `clojure--replace-sexps-with-binding`.
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