unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* debugging elisp ?
@ 2017-07-09  8:03 Jean-Christophe Helary
  2017-07-09  9:44 ` Marcin Borkowski
  0 siblings, 1 reply; 10+ messages in thread
From: Jean-Christophe Helary @ 2017-07-09  8:03 UTC (permalink / raw)
  To: Emacs-Devel devel

Is there a way to run a given package/file step by step and see how variables etc. evolve ?

Practically speaking I'm running package.el and I'd like to have a separate buffer where I see how things move under the hood.

Jean-Christophe


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: debugging elisp ?
  2017-07-09  8:03 debugging elisp ? Jean-Christophe Helary
@ 2017-07-09  9:44 ` Marcin Borkowski
  2017-07-09 10:49   ` Jean-Christophe Helary
  0 siblings, 1 reply; 10+ messages in thread
From: Marcin Borkowski @ 2017-07-09  9:44 UTC (permalink / raw)
  To: Jean-Christophe Helary; +Cc: Emacs-Devel devel


On 2017-07-09, at 10:03, Jean-Christophe Helary <jean.christophe.helary@gmail.com> wrote:

> Is there a way to run a given package/file step by step and see how variables etc. evolve ?
>
> Practically speaking I'm running package.el and I'd like to have a separate buffer where I see how things move under the hood.

That's exactly what Edebug does!

Evaluate this: (info "(elisp) Edebug") and have fun.

Hth,

-- 
Marcin Borkowski



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: debugging elisp ?
  2017-07-09  9:44 ` Marcin Borkowski
@ 2017-07-09 10:49   ` Jean-Christophe Helary
  2017-07-09 11:48     ` Noam Postavsky
  0 siblings, 1 reply; 10+ messages in thread
From: Jean-Christophe Helary @ 2017-07-09 10:49 UTC (permalink / raw)
  To: Emacs-Devel devel


> On Jul 9, 2017, at 18:44, Marcin Borkowski <mbork@mbork.pl> wrote:
> 
> 
> On 2017-07-09, at 10:03, Jean-Christophe Helary <jean.christophe.helary@gmail.com> wrote:
> 
>> Is there a way to run a given package/file step by step and see how variables etc. evolve ?
>> 
>> Practically speaking I'm running package.el and I'd like to have a separate buffer where I see how things move under the hood.
> 
> That's exactly what Edebug does!

My limited understanding of the documentation tells me that I can't keep the debugger working during the whole package session. I can call it on package-list-packages and it will run until the package list is displayed, and then it quits.

Does that mean that I have to mark all the package functions for debugging ?

Jean-Christophe


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: debugging elisp ?
  2017-07-09 10:49   ` Jean-Christophe Helary
@ 2017-07-09 11:48     ` Noam Postavsky
  2017-07-09 11:58       ` Jean-Christophe Helary
  2017-07-09 11:59       ` Marcin Borkowski
  0 siblings, 2 replies; 10+ messages in thread
From: Noam Postavsky @ 2017-07-09 11:48 UTC (permalink / raw)
  To: Jean-Christophe Helary; +Cc: Emacs-Devel devel

On Sun, Jul 9, 2017 at 6:49 AM, Jean-Christophe Helary
<jean.christophe.helary@gmail.com> wrote:
>
> My limited understanding of the documentation tells me that I can't keep the debugger working during the whole package session. I can call it on package-list-packages and it will run until the package list is displayed, and then it quits.
>
> Does that mean that I have to mark all the package functions for debugging ?

Yes, you can do that with the following code:

(require 'edebug)
(require 'package)
(mapatoms (lambda (s) (and (fboundp s)
                      (string-match-p "\\`package" (symbol-name s)))
            (edebug-instrument-function s)))



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: debugging elisp ?
  2017-07-09 11:48     ` Noam Postavsky
@ 2017-07-09 11:58       ` Jean-Christophe Helary
  2017-07-09 11:59       ` Marcin Borkowski
  1 sibling, 0 replies; 10+ messages in thread
From: Jean-Christophe Helary @ 2017-07-09 11:58 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Emacs-Devel devel


> On Jul 9, 2017, at 20:48, Noam Postavsky <npostavs@users.sourceforge.net> wrote:
> 
> On Sun, Jul 9, 2017 at 6:49 AM, Jean-Christophe Helary
> <jean.christophe.helary@gmail.com> wrote:
>> 
>> My limited understanding of the documentation tells me that I can't keep the debugger working during the whole package session. I can call it on package-list-packages and it will run until the package list is displayed, and then it quits.
>> 
>> Does that mean that I have to mark all the package functions for debugging ?
> 
> Yes, you can do that with the following code:
> 
> (require 'edebug)
> (require 'package)
> (mapatoms (lambda (s) (and (fboundp s)
>                      (string-match-p "\\`package" (symbol-name s)))
>            (edebug-instrument-function s)))

Thank you very much.

So there is no way I can run package without marking all the functions for debugging?

Jean-Christophe 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: debugging elisp ?
  2017-07-09 11:48     ` Noam Postavsky
  2017-07-09 11:58       ` Jean-Christophe Helary
@ 2017-07-09 11:59       ` Marcin Borkowski
  2017-07-09 12:13         ` Noam Postavsky
  2017-07-09 13:54         ` Jean-Christophe Helary
  1 sibling, 2 replies; 10+ messages in thread
From: Marcin Borkowski @ 2017-07-09 11:59 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Jean-Christophe Helary, Emacs-Devel devel


On 2017-07-09, at 13:48, Noam Postavsky <npostavs@users.sourceforge.net> wrote:

> On Sun, Jul 9, 2017 at 6:49 AM, Jean-Christophe Helary
> <jean.christophe.helary@gmail.com> wrote:
>>
>> My limited understanding of the documentation tells me that I can't keep the debugger working during the whole package session. I can call it on package-list-packages and it will run until the package list is displayed, and then it quits.
>>
>> Does that mean that I have to mark all the package functions for debugging ?
>
> Yes, you can do that with the following code:
>
> (require 'edebug)
> (require 'package)
> (mapatoms (lambda (s) (and (fboundp s)
>                       (string-match-p "\\`package" (symbol-name s)))
>             (edebug-instrument-function s)))

Won't
M-x edebug-all-defuns
and then
M-x eval-buffer
in package.el work as well (and be easier)?

Best,

-- 
Marcin Borkowski



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: debugging elisp ?
  2017-07-09 11:59       ` Marcin Borkowski
@ 2017-07-09 12:13         ` Noam Postavsky
  2017-07-09 13:54         ` Jean-Christophe Helary
  1 sibling, 0 replies; 10+ messages in thread
From: Noam Postavsky @ 2017-07-09 12:13 UTC (permalink / raw)
  To: Marcin Borkowski; +Cc: Jean-Christophe Helary, Emacs-Devel devel

On Sun, Jul 9, 2017 at 7:59 AM, Marcin Borkowski <mbork@mbork.pl> wrote:
>
> Won't
> M-x edebug-all-defuns
> and then
> M-x eval-buffer
> in package.el work as well (and be easier)?

Oh, yes, good point. I usually mark only some functions with
edebug-instrument-function in a dolist loop, so I didn't think of the
more straightforward way.

On Sun, Jul 9, 2017 at 7:58 AM, Jean-Christophe Helary
<jean.christophe.helary@gmail.com> wrote:
>
> So there is no way I can run package without marking all the functions for debugging?

You can run package without marking it, but you can't step with edebug
through a function without without instrumenting it first. You can
instrument other functions while debugging if you see something
interesting, see (elisp) Instrumenting.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: debugging elisp ?
  2017-07-09 11:59       ` Marcin Borkowski
  2017-07-09 12:13         ` Noam Postavsky
@ 2017-07-09 13:54         ` Jean-Christophe Helary
  2017-07-10 13:31           ` Michael Heerdegen
  1 sibling, 1 reply; 10+ messages in thread
From: Jean-Christophe Helary @ 2017-07-09 13:54 UTC (permalink / raw)
  To: Emacs-Devel devel

I tried all the proposed solutions but I don't get what I'd like to have.

What I'd like to have is:

I run package in a window and in a different window I have all the variables/messages etc. appearing as I work inside package.

Maybe my "step by step" wording did not reflect what I really meant. Now that I see how it works, it is way too cumbersome for what I want to do, which is basically have a view on all the internal data as the package is run.

Jean-Christophe

> On Jul 9, 2017, at 20:59, Marcin Borkowski <mbork@mbork.pl> wrote:
> 
> 
> On 2017-07-09, at 13:48, Noam Postavsky <npostavs@users.sourceforge.net> wrote:
> 
>> On Sun, Jul 9, 2017 at 6:49 AM, Jean-Christophe Helary
>> <jean.christophe.helary@gmail.com> wrote:
>>> 
>>> My limited understanding of the documentation tells me that I can't keep the debugger working during the whole package session. I can call it on package-list-packages and it will run until the package list is displayed, and then it quits.
>>> 
>>> Does that mean that I have to mark all the package functions for debugging ?
>> 
>> Yes, you can do that with the following code:
>> 
>> (require 'edebug)
>> (require 'package)
>> (mapatoms (lambda (s) (and (fboundp s)
>>                      (string-match-p "\\`package" (symbol-name s)))
>>            (edebug-instrument-function s)))
> 
> Won't
> M-x edebug-all-defuns
> and then
> M-x eval-buffer
> in package.el work as well (and be easier)?
> 
> Best,
> 
> -- 
> Marcin Borkowski




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: debugging elisp ?
  2017-07-09 13:54         ` Jean-Christophe Helary
@ 2017-07-10 13:31           ` Michael Heerdegen
  2017-07-11  1:06             ` Jean-Christophe Helary
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Heerdegen @ 2017-07-10 13:31 UTC (permalink / raw)
  To: Jean-Christophe Helary; +Cc: Emacs-Devel devel

Jean-Christophe Helary <jean.christophe.helary@gmail.com> writes:

> I tried all the proposed solutions but I don't get what I'd like to have.
>
> What I'd like to have is:
>
> I run package in a window and in a different window I have all the
> variables/messages etc. appearing as I work inside package.

You should have a look at trace.el if you haven't yet.  Not exactly what
you want, but a good tool for basic non-interactive inspection.


Michael.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: debugging elisp ?
  2017-07-10 13:31           ` Michael Heerdegen
@ 2017-07-11  1:06             ` Jean-Christophe Helary
  0 siblings, 0 replies; 10+ messages in thread
From: Jean-Christophe Helary @ 2017-07-11  1:06 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Emacs-Devel devel


> On Jul 10, 2017, at 22:31, Michael Heerdegen <michael_heerdegen@web.de> wrote:

>> I run package in a window and in a different window I have all the
>> variables/messages etc. appearing as I work inside package.
> 
> You should have a look at trace.el if you haven't yet.  Not exactly what
> you want, but a good tool for basic non-interactive inspection.

Thank you. I will try.

Jean-Christophe 


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-07-11  1:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-09  8:03 debugging elisp ? Jean-Christophe Helary
2017-07-09  9:44 ` Marcin Borkowski
2017-07-09 10:49   ` Jean-Christophe Helary
2017-07-09 11:48     ` Noam Postavsky
2017-07-09 11:58       ` Jean-Christophe Helary
2017-07-09 11:59       ` Marcin Borkowski
2017-07-09 12:13         ` Noam Postavsky
2017-07-09 13:54         ` Jean-Christophe Helary
2017-07-10 13:31           ` Michael Heerdegen
2017-07-11  1:06             ` Jean-Christophe Helary

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).