trace.el: Make it usable in batch mode as well
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 19 Jan 2024 20:02:50 +0000 (15:02 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 19 Jan 2024 20:02:50 +0000 (15:02 -0500)
commit1293aac0df4e2837a141818f225539ec847b6684
tree66c386204cb7858faa2db0b39851ac819a9379cb
parentbd5bfc29137b6e452e1900a1fc3cf09e77959133
trace.el: Make it usable in batch mode as well

While at it, this fixes a bug where a traced function was not
able to set `deactivate-mark`.

* lisp/emacs-lisp/trace.el (trace--insert): New function, extracted
from `trace-make-advice`.  Output to stdout in batch mode.
(trace--entry-message): Rename from `trace-entry-message`.
Change calling convention.  Do the insertion directly from here.
(trace--exit-message): Rename from `trace-exit-message`.
Change calling convention.  Do the insertion directly from here.
(trace-make-advice, trace-values): Simplify accordingly.
lisp/emacs-lisp/trace.el