From ebc77efd0f44784d7b75f365be4da3abb3fe31d5 Mon Sep 17 00:00:00 2001 From: Akib Azmain Turja Date: Wed, 7 Dec 2022 15:34:14 +0600 Subject: [PATCH] Escape control characters in trace output * eat.el (eat--trace-log): Escape control characters (codepoints from 0 to 31) in trace output. --- eat.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eat.el b/eat.el index d9cc29d..88ae5de 100644 --- a/eat.el +++ b/eat.el @@ -5789,7 +5789,8 @@ to the end of (accessible portion of) buffer." (goto-char (point-max)) ;; Hope that `float-time' won't roll over while tracing. ;-) (insert (replace-regexp-in-string - "\n" "\\\\n" + (rx (any (0 . 31))) + (lambda (string) (format "\\\\x%02x" (aref string 0))) (format "%S" `(,(float-time time) ,operation ,@args))) ?\n))