diff --git a/core/core-spacemacs.el b/core/core-spacemacs.el index 7c5b38f1d..e04956959 100644 --- a/core/core-spacemacs.el +++ b/core/core-spacemacs.el @@ -227,4 +227,21 @@ "You can paste it in the gitter chat.\n" "Check the *Messages* buffer if you need to review it")))) +(defun spacemacs/describe-last-keys () + "Gathers info about your Emacs last keys and copies to clipboard." + (interactive) + (view-lossage) + (let* ((lossage-buffer "*Help*") + (lossage (format "#### Emacs last keys\n```text\n%s```\n" + (with-current-buffer lossage-buffer + (buffer-string))))) + (kill-buffer lossage-buffer) + (kill-new lossage) + (message lossage) + (message (concat "Information has been copied to clipboard.\n" + (propertize + "PLEASE REVIEW THE DATA BEFORE GOING FURTHER AS IT CAN CONTAIN SENSITIVE DATA (PASSWORD, ...)\n" + 'face 'font-lock-warning-face) + "You can paste it in the gitter chat.\n" + "Check the *Messages* buffer if you need to review it")))) (provide 'core-spacemacs) diff --git a/doc/DOCUMENTATION.org b/doc/DOCUMENTATION.org index 74563ab98..25aaa67bf 100644 --- a/doc/DOCUMENTATION.org +++ b/doc/DOCUMENTATION.org @@ -1274,6 +1274,7 @@ thusly: | ~SPC h d F~ | describe a face | | ~SPC h d k~ | describe a key | | ~SPC h d K~ | describe a keymap | +| ~SPC h d l~ | copy last pressed keys that you can paste in gitter chat | | ~SPC h d m~ | describe current modes | | ~SPC h d p~ | describe a package | | ~SPC h d s~ | copy system information that you can paste in gitter chat | diff --git a/layers/+distribution/spacemacs-base/keybindings.el b/layers/+distribution/spacemacs-base/keybindings.el index 3e4d603e1..0de0049ea 100644 --- a/layers/+distribution/spacemacs-base/keybindings.el +++ b/layers/+distribution/spacemacs-base/keybindings.el @@ -108,6 +108,7 @@ "hdc" 'describe-char "hdf" 'describe-function "hdk" 'describe-key + "hdl" 'spacemacs/describe-last-keys "hdp" 'describe-package "hds" 'spacemacs/describe-system-info "hdt" 'describe-theme