From 677f4af801877d1a65c1905bef32f24e327d6800 Mon Sep 17 00:00:00 2001 From: Soonho Kong Date: Thu, 4 Sep 2014 15:42:10 -0700 Subject: [PATCH] feat(emacs/lean-server): add debug print --- src/emacs/lean-server.el | 9 +++++++++ 1 file changed, 9 insertions(+) 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