Add doom/copy-backtrace command

This commit is contained in:
Henrik Lissner 2018-07-13 13:00:42 +02:00
parent 6e52e2d07c
commit 7ed9c5196f
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -120,6 +120,19 @@ branch and commit."
(or (vc-git-working-revision doom-core-dir)
"n/a")))
;;;###autoload
(defun doom/copy-backtrace ()
"Copy the contents of the *Backtrace* window to clipboard."
(interactive)
(if-let* ((buf (get-buffer "*Backtrace*")))
(with-current-buffer buf
(kill-new
(string-trim
(buffer-substring-no-properties
(point-min)
(min (point-max) 1000)))))
(user-error "No backtrace buffer detected")))
;;
;; Vanilla sandbox