Skip to content

Commit 49b8c4b

Browse files
arichiardibbatsov
authored andcommitted
Restyle inf-clojure-log-activity output
1 parent 86d0b60 commit 49b8c4b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

inf-clojure.el

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -959,14 +959,16 @@ Inf-Clojure will create a log file in the project folder named
959959
`inf-clojure--log-file-name' and dump the process activity in it
960960
in case this is not nil." )
961961

962-
(defun inf-clojure--log-string (string &optional type)
962+
(defun inf-clojure--log-string (string &optional tag)
963963
"Log STRING to file, according to `inf-clojure-log-response'.
964964
The optional TYPE will be converted to string and printed before
965965
STRING if present."
966966
(when inf-clojure-log-activity
967967
(write-region (concat "\n"
968-
(when type
969-
(concat (prin1-to-string type) " | "))
968+
(when tag
969+
(if (stringp tag)
970+
(concat tag "\n")
971+
(concat (prin1-to-string tag) "\n")))
970972
(let ((print-escape-newlines t))
971973
(prin1-to-string string)))
972974
nil
@@ -985,7 +987,7 @@ string will start from (point) in the results buffer. If
985987
END-STRING is nil, the result string will end at (point-max) in
986988
the results buffer. It cuts out the output from and including
987989
the `inf-clojure-prompt`."
988-
(inf-clojure--log-string command :cmd)
990+
(inf-clojure--log-string command "----CMD->")
989991
(let ((work-buffer inf-clojure--redirect-buffer-name))
990992
(save-excursion
991993
(set-buffer (get-buffer-create work-buffer))
@@ -1008,7 +1010,7 @@ the `inf-clojure-prompt`."
10081010
(prompt (when (search-forward inf-clojure-prompt nil t)
10091011
(match-beginning 0)))
10101012
(buffer-string (buffer-substring-no-properties beg (or prompt end))))
1011-
(inf-clojure--log-string buffer-string :res)
1013+
(inf-clojure--log-string buffer-string "<-RES----")
10121014
buffer-string))))
10131015

10141016
(defun inf-clojure--nil-string-match-p (string)

0 commit comments

Comments
 (0)