all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: emacs-devel@gnu.org
Subject: Re: How to debug indentation
Date: Sat, 26 May 2018 03:41:03 +0200	[thread overview]
Message-ID: <87zi0n5h3k.fsf@web.de> (raw)
In-Reply-To: <874livtyp2.fsf@gmail.com> (N. Raghavendra's message of "Fri, 25 May 2018 23:17:05 +0530")

"N. Raghavendra" <nyraghu27132@gmail.com> 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	other threads:[~2018-05-26  1:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-25  2:58 How to debug indentation N. Raghavendra
2018-05-25  3:45 ` N. Raghavendra
2018-05-25  5:24 ` Stefan Monnier
2018-05-25 17:47   ` N. Raghavendra
2018-05-26  1:41     ` Michael Heerdegen [this message]
2018-05-26  2:26       ` N. Raghavendra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zi0n5h3k.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.