From d0e30ed23a53f965f3003d9aa7282190fe3df088 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Wed, 2 Feb 2022 12:15:03 -0800 Subject: 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 Autosubmit: wpcarro --- users/wpcarro/emacs/.emacs.d/wpc/wpc-lisp.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'users/wpcarro/emacs') diff --git a/users/wpcarro/emacs/.emacs.d/wpc/wpc-lisp.el b/users/wpcarro/emacs/.emacs.d/wpc/wpc-lisp.el index 4984e5dccddd..599d42620419 100644 --- a/users/wpcarro/emacs/.emacs.d/wpc/wpc-lisp.el +++ b/users/wpcarro/emacs/.emacs.d/wpc/wpc-lisp.el @@ -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 "" :states 'normal + "c" #'wpc-lisp-copy-elisp-eval-output "x" #'eval-defun "X" #'eval-buffer "d" (lambda () -- cgit 1.4.1