diff --git a/src/emacs/lean-server.el b/src/emacs/lean-server.el index 628fcc771..a2924ed23 100644 --- a/src/emacs/lean-server.el +++ b/src/emacs/lean-server.el @@ -16,6 +16,7 @@ (defvar-local lean-server-process-name "lean-server") (defvar-local lean-server-buffer-name "*lean-server*") (defvar-local lean-server-trace-buffer-name "*lean-server-trace*") +(defvar-local lean-server-debug-buffer-name "*lean-server-debug*") (defvar-local lean-server-option "--server") ;; Log Function @@ -39,6 +40,14 @@ (setq lean-global-server-last-time-sent (float-time)) (insert (apply 'format format-string args)))) +(defun lean-server-debug (format-string &rest args) + "Display a message at the bottom of the *lean-server-debug* buffer." + (with-current-buffer + (get-buffer-create lean-server-debug-buffer-name) + (goto-char (point-max)) + (insert (format-time-string "%H:%M:%S:%3N -- " (current-time))) + (insert (apply 'format (concat format-string "\n") args)))) + ;; How to read data from an async process ;; ====================================== (defconst lean-server-syntax-pattern