Created
October 26, 2020 15:14
-
-
Save dpsutton/7556cf1f4ecfc97da7b7e9d6dbf210c6 to your computer and use it in GitHub Desktop.
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
;; ‘C-x r s <register-key>’ save to register | |
;; 'C-c C-j x <register-key' to send to repl | |
(defun cider-insert-register-contents (register) | |
(interactive (list (register-read-with-preview "From register"))) | |
(let ((form (get-register register))) | |
;; could put form into a buffer and check if its parens are | |
;; balanced | |
(if form | |
(cider-insert-in-repl form (not cider-invert-insert-eval-p)) | |
(user-error "No saved form in register")))) | |
(define-key 'cider-insert-commands-map (kbd "x") #'cider-insert-register-contents) | |
(define-key 'cider-insert-commands-map (kbd "C-x") #'cider-insert-register-contents) | |
(define-key cider-repl-mode-map (kbd "C-c C-j") 'cider-insert-commands-map) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment