Skip to content
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

Created cider-eval-last-sexp-to-comment #2101

Conversation

marcelotoledo
Copy link

Created cider-eval-last-sexp-to-comment which is more flexible and useful than cider-eval-defun-to-comment. You're able to eval to comment any sexp and not only functions. Also rebinded the shortcut C-c M-; to this new func.

Marcelo Toledo added 2 commits October 24, 2017 19:29
…eful than cider-eval-defun-to-comment. You're able to eval to comment any sexp and not only functions. Also rebinded the shortcut C-c M-; to this new func.

With a prefix arg, LOC, insert before the form, otherwise afterwards."
(interactive "P")
(let* ((bounds (cider-defun-at-point 'bounds))
Copy link
Member

Choose a reason for hiding this comment

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

Seems to me you just copy pasted the code of the other function here. :-)

The repetition between the two functions should be factored out into some common helper.

@@ -304,7 +304,7 @@ Configure `cider-cljs-*-repl' to change the ClojureScript REPL to use for your b
(define-key map (kbd "C-x C-e") #'cider-eval-last-sexp)
(define-key map (kbd "C-c C-e") #'cider-eval-last-sexp)
(define-key map (kbd "C-c C-v") 'cider-eval-commands-map)
(define-key map (kbd "C-c M-;") #'cider-eval-defun-to-comment)
(define-key map (kbd "C-c M-;") #'cider-eval-last-sexp-to-comment)
Copy link
Member

Choose a reason for hiding this comment

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

Unbinding functions like this is never a good idea. Try to think of a new binding for this function. Also mention it in the command listings in menus and documents.

@bbatsov
Copy link
Member

bbatsov commented Dec 2, 2017

@marcelotoledo Ping :-)

@bbatsov
Copy link
Member

bbatsov commented Dec 9, 2017

Also, this should take into account the changes introduced in #2111.

@bbatsov
Copy link
Member

bbatsov commented Dec 13, 2017

I'll close this for now due to lack of activity. Feel free to reopen it, if you I ever revisit it.

@bbatsov bbatsov closed this Dec 13, 2017
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