-
-
Notifications
You must be signed in to change notification settings - Fork 646
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
Created cider-eval-last-sexp-to-comment #2101
Conversation
…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)) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
@marcelotoledo Ping :-) |
Also, this should take into account the changes introduced in #2111. |
I'll close this for now due to lack of activity. Feel free to reopen it, if you I ever revisit it. |
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.