emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/coterm a5d4ddf: Implement simple optional debug logging


From: ELPA Syncer
Subject: [elpa] externals/coterm a5d4ddf: Implement simple optional debug logging
Date: Thu, 14 Oct 2021 12:57:14 -0400 (EDT)

branch: externals/coterm
commit a5d4ddfe33263e256cb1a3c64f216582c0be003e
Author: Miha Rihtaršič <miha@kamnitnik.top>
Commit: Miha Rihtaršič <miha@kamnitnik.top>

    Implement simple optional debug logging
---
 coterm.el | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/coterm.el b/coterm.el
index b6fe4ba..8909a85 100644
--- a/coterm.el
+++ b/coterm.el
@@ -538,6 +538,11 @@ is the process mark."
 
 (defconst coterm--t-control-seq-prefix-regexp "\e")
 
+(defvar coterm--t-log-buffer nil
+  "If non-nil, log process output to this buffer.
+Set it to a name of a buffer if you want to record process output
+for debugging purposes.")
+
 (defvar-local coterm--t-height nil
   "Number of lines in window.")
 (defvar-local coterm--t-width nil
@@ -868,6 +873,13 @@ buffer and the scrolling region must cover the whole 
screen."
           (funcall proc-filt process string)
 
         (with-current-buffer buf
+          (when coterm--t-log-buffer
+            (with-current-buffer (get-buffer-create coterm--t-log-buffer)
+              (save-excursion
+                (goto-char (point-max))
+                (insert (make-string 70 ?=) ?\n)
+                (insert string ?\n))))
+
           (when-let ((fragment coterm--t-unhandled-fragment))
             (setq string (concat fragment string))
             (setq coterm--t-unhandled-fragment nil))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]