Skip to content

[Fix #313] pf doesn't understand %& #327

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 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

- [#299](https://github.com/clojure-emacs/clj-refactor.el/issues/299) `ml` moves cursor
- [#309](https://github.com/clojure-emacs/clj-refactor.el/issues/309) `am` creates alias for fully-qualified symbols.
- [#313](https://github.com/clojure-emacs/clj-refactor.el/issues/313) teach `pf` about function literals using `%&`.
- [#320](https://github.com/clojure-emacs/clj-refactor.el/issues/320) `*data-readers*` ignored when searching for macros.
Copy link
Member Author

Choose a reason for hiding this comment

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

Lol

that copy paste error propagated through all my commits


## 2.2.0
Expand Down
6 changes: 4 additions & 2 deletions clj-refactor.el
Original file line number Diff line number Diff line change
Expand Up @@ -2617,10 +2617,12 @@ See: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-update-project-d
(cljr--goto-fn-definition)
(let ((fn-start (point))
var replacement)
(while (re-search-forward "%[1-9]?" (cljr--point-after 'paredit-forward) t)
(while (re-search-forward "%[1-9&]?" (cljr--point-after 'paredit-forward) t)
(setq var (buffer-substring (point) (cljr--point-after 'paredit-backward)))
(setq replacement (read-string (format "%s => " var)))
(cljr--append-fn-parameter replacement)
(cljr--append-fn-parameter (if (string= "%&" var)
(format "& %s" replacement)
replacement))
(goto-char (1+ fn-start))
(let ((end (cljr--point-after '(paredit-forward-up 2))))
(while (re-search-forward (format "\\s-%s\\(\\s-\\|\\|\n)\\)" var)
Expand Down