Escape control characters in trace output

* eat.el (eat--trace-log): Escape control
characters (codepoints from 0 to 31) in trace output.
This commit is contained in:
Akib Azmain Turja 2022-12-07 15:34:14 +06:00
parent e6a7deafd0
commit ebc77efd0f
No known key found for this signature in database
GPG key ID: 5535FCF54D88616B

3
eat.el
View file

@ -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))