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

At 2018-05-26T03:41:03+02:00, Michael Heerdegen wrote:

> 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.

That's helpful.  I'll try that.

Thanks,
Raghu.

--
N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/



      reply	other threads:[~2018-05-26  2:26 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
2018-05-26  2:26       ` N. Raghavendra [this message]

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=87y3g7rw3h.fsf@gmail.com \
    --to=nyraghu27132@gmail.com \
    --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.