Created
October 30, 2014 11:19
-
-
Save ustun/0f1a86142b95a391773c to your computer and use it in GitHub Desktop.
cider print defun to repl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun cider-eval-defun-at-point-in-repl () | |
(interactive) | |
(let ((form (cider-defun-at-point))) | |
;; Strip excess whitespace | |
(while (string-match "\\`\s+\\|\n+\\'" form) | |
(setq form (replace-match "" t t form))) | |
(cider-switch-to-current-repl-buffer) | |
;;(set-buffer (cider-find-or-create-repl-buffer)) | |
(goto-char (point-max)) | |
(insert form) | |
(cider-repl-return)) | |
(cider-switch-to-last-clojure-buffer)) | |
(define-key clojure-mode-map [M-return] 'cider-eval-defun-at-point-in-repl) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment