]> git.eshelyaron.com Git - emacs.git/commit
* lisp/emacs-lisp/trace.el: Allow trace context args to be forms
authorPhil Sainty <psainty@orcon.net.nz>
Fri, 12 Aug 2022 07:47:33 +0000 (19:47 +1200)
committerPhil Sainty <psainty@orcon.net.nz>
Fri, 12 Aug 2022 12:36:49 +0000 (00:36 +1200)
commitfaf43bcab15df1bddcc83f954494104d5c0e6862
tree5012fd6b76158bf87dff69af0c6fbe511fee8ba8
parent69e105bc482672a4a1e0e3031a890c1674358a24
* lisp/emacs-lisp/trace.el: Allow trace context args to be forms

This lifts the restriction of context arguments needing to be
functions, when calling trace functions from lisp code.

(trace--read-extra-args, trace-entry-message, trace-entry-message):
Move the output formatting already used for interactive context into
the trace-*-message functions for use in non-interactive cases as
well.  Previously it was necessary for context functions to format
their output in a trace-aware manner, making a custom wrapper function
necessary to obtain well-formatted output even when the desired
context had an existing function.

(trace-function-internal, trace-make-advice): Move the generation of
an 'empty' context function into `trace-make-advice', which now takes
care of generating a function for any non-function context.

(trace-make-context): New function returning a context function for
an expression argument; extracted from `trace--read-extra-args'.
(trace--read-extra-args, trace-make-advice): Call it.

* doc/lispref/debugging.texi: Update documentation.
doc/lispref/debugging.texi
lisp/emacs-lisp/trace.el