feat(wpcarro/emacs): Define KBD to copy result of elisp evaluation

I've wanted this for awhile...

Change-Id: Ic010fee6a7adc0aa793e4ca2179b90f4463d1eec
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5197
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
This commit is contained in:
William Carroll 2022-02-02 12:15:03 -08:00 committed by clbot
parent 41faf1cf91
commit d0e30ed23a

View file

@ -100,10 +100,18 @@
:config
(general-add-hook 'emacs-lisp-mode #'ielm-mode))
(defun wpc-lisp-copy-elisp-eval-output ()
"Copy the output of the elisp evaluation"
(interactive)
(call-interactively 'eval-last-sexp)
(clipboard-copy (current-message)
:message (format "%s - copied!" (current-message))))
(general-define-key
:keymaps 'emacs-lisp-mode-map
:prefix "<SPC>"
:states 'normal
"c" #'wpc-lisp-copy-elisp-eval-output
"x" #'eval-defun
"X" #'eval-buffer
"d" (lambda ()