emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to debug indentation


From: Michael Heerdegen
Subject: Re: How to debug indentation
Date: Sat, 26 May 2018 03:41:03 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

"N. Raghavendra" <address@hidden> writes:

> I can see what `trace-function' does, but can't make out how to use
> `trace-values'.  I saw trace.el, but there is no documentation there
> about it.

It has a docstring.

>  Can you give some idea of how to use it?

AFAICT you just place into in the code, reevaluate, and it will print
values into the trace buffer.  E.g.

(defun fac (x)
  (trace-values (cons 'x x))
  (if (< x 2) 1 (* x (fac (1- x)))))

Tracing `fac' and evaluating (fac 3) gives you a trace buffer like

1 -> (fac 3)
1 -> (trace-values (x . 3))
  2 -> (fac 2) 
  2 -> (trace-values (x . 2))
    3 -> (fac 1)
    3 -> (trace-values (x . 1))
    3 <- fac: 1
  2 <- fac: 2
1 <- fac: 6

Nothing more.


Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]