Skip to content

Last occurrence of expression sometimes not replaced when using move-to-let #429

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
benedekfazekas opened this issue Apr 7, 2017 · 0 comments
Assignees
Labels

Comments

@benedekfazekas
Copy link
Member

Use the template below when reporting bugs. Please, make sure that
you're running the latest stable clojure-mode and that the problem you're reporting
hasn't been reported (and potentially fixed) already.

Remove all of the placeholder text in your final report!

Expected behavior

All occurrences of an expression inside the let should replaced with newly introduced bound name.

Actual behavior

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

@benedekfazekas benedekfazekas self-assigned this Apr 7, 2017
benedekfazekas added a commit that referenced this issue 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`.
benedekfazekas added a commit that referenced this issue 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`.
benedekfazekas added a commit that referenced this issue 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`.
@bbatsov bbatsov closed this as completed in 2d67af4 Apr 7, 2017
slipset pushed a commit to slipset/clojure-mode that referenced this issue 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
Projects
None yet
Development

No branches or pull requests

1 participant