-
-
Notifications
You must be signed in to change notification settings - Fork 645
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
Add cider-eval-dwim #3496
Add cider-eval-dwim #3496
Conversation
647fac8
to
bda7809
Compare
Thanks for the PR! You can merge master in, in order for the CI warning to disappear. |
cider-mode.el
Outdated
@@ -495,6 +496,7 @@ higher precedence." | |||
(define-key map (kbd "M-TAB") #'complete-symbol) | |||
(define-key map (kbd "C-M-x") #'cider-eval-defun-at-point) | |||
(define-key map (kbd "C-c C-c") #'cider-eval-defun-at-point) | |||
(define-key map (kbd "C-c C-d") #'cider-eval-dwim) |
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.
Please use a keybinding in the eval keymap, instead of this one.
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.
Is C-c C-v C-d
appropriate?
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.
Yeah, that's fine, just keep in mind that all keybindings in the eval keymap should have both a variant with and without Control
- C-c C-v d
and C-c C-v C-d
. (some people don't like letting go of Control in complex keybindings)
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.
C-c C-v C-d
was already taken by eval-defun
so I changed d
to s
.
bda7809
to
14f3c10
Compare
2cdb98b
to
89a746d
Compare
89a746d
to
8c8b201
Compare
ebebffe
to
b7c6f4a
Compare
(if (use-region-p) | ||
(cider-eval-region (region-beginning) (region-end)) | ||
(cider-eval-defun-at-point debug-it))) | ||
(let ((clojure-toplevel-inside-comment-form t)) |
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.
I'm guessing you should also mention this in the docstring.
Thanks much for your contribution! I squashed it with some docstring and changelog tweaks, preserving attribution. |
If no region is active, eval the toplevel form with
cider-eval-defun-at-point
.If a region is active, run
cider-eval-region
.Tiny function, but I find it useful. If there are any other situations/commands to add I'm all ears.
checkdoc
stuck: "Documentation style: Checking..."eldev test
)eldev lint
) which is based onelisp-lint
. There are warnings but they are unrelated to my changes.