From 7ed9c5196fb8a10ba87f301f3ae974b4c317e0f7 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 13 Jul 2018 13:00:42 +0200 Subject: [PATCH] Add doom/copy-backtrace command --- core/autoload/debug.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/autoload/debug.el b/core/autoload/debug.el index 5a096b816..0e531594c 100644 --- a/core/autoload/debug.el +++ b/core/autoload/debug.el @@ -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