From ac600f091630480188932ad8d2ee315c8ee84c8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Medra=C3=B1o=20Calvo?= Date: Mon, 13 Aug 2018 12:00:00 +0000 Subject: [PATCH] Commands for interacting with the log buffer remotely * exwm-debug.el (exwm-debug--clear, exwm-debug--mark): New functions. --- exwm-core.el | 5 +++++ exwm-debug.el | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/exwm-core.el b/exwm-core.el index 66b7917..5c501e4 100644 --- a/exwm-core.el +++ b/exwm-core.el @@ -290,6 +290,11 @@ least SECS seconds later." (/= ,i exwm-workspace-current-index)]) (number-sequence 0 (1- (exwm-workspace--count)))))))) +(exwm--debug + (let ((map exwm-mode-map)) + (define-key map "\C-c\C-l" #'exwm-debug--clear) + (define-key map "\C-c\C-m" #'exwm-debug--mark))) + (define-derived-mode exwm-mode nil "EXWM" "Major mode for managing X windows. diff --git a/exwm-debug.el b/exwm-debug.el index 89421da..cd2ec39 100644 --- a/exwm-debug.el +++ b/exwm-debug.el @@ -97,6 +97,18 @@ the passed OBJECTS. See `format' for details." (debugger (lambda (&rest _) (exwm-debug--backtrace)))) ,@forms)) +(defun exwm-debug--clear () + "Clear the debug buffer." + (interactive) + (exwm-debug--with-debug-buffer + (erase-buffer))) + +(defun exwm-debug--mark () + "Insert a mark in the debug buffer." + (interactive) + (exwm-debug--with-debug-buffer + (insert " \n"))) + (provide 'exwm-debug)