all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Wrong type argument: arrayp, nil
@ 2014-04-20 17:44 Gracjan Polak
  2014-04-20 18:16 ` Drew Adams
  0 siblings, 1 reply; 5+ messages in thread
From: Gracjan Polak @ 2014-04-20 17:44 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

I'm not sure if this is the correct place, I suspect it is not so please
forward me where to go.

So I was happily hacking on something totally other when my language
indentation mode after a TAB responded with friendly: Wrong type argument:
arrayp, nil.

Being ambitious programmer as I am I decided to debug the issue in the
indentation package that I use.

I have zero experience hacking emacs although I had used it for years now.

Here are steps I took:

Downloaded source code of package in question.

Looked up how to use some kind of debugging under emacs, found Edebug (not
sure if I found right).

Used C-u C-M-x to instrument main entry the function that got set in var
indent-line-function.

Added a friendly (please-break-here) so i know edebug got hooked properly.

Pressed TAB to indent...

Nothing happened.

Is there a how-to-debug-elisp tutorial somewhere? Currently I have no idea
how to setup my environment.

Where do I proceed?

-- 
Gracjan





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

* RE: Wrong type argument: arrayp, nil
  2014-04-20 17:44 Wrong type argument: arrayp, nil Gracjan Polak
@ 2014-04-20 18:16 ` Drew Adams
  2014-04-20 18:25   ` Gracjan Polak
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2014-04-20 18:16 UTC (permalink / raw)
  To: Gracjan Polak, help-gnu-emacs

First, do this, to get a human-readable backtrace:

1. Set variable `debug-on-error' to t.
2. Provoke the error, so you can see which function is problematic.
   Quit the debugger using `q'.
3. Load the source files for the package in question.  This is to
   give you a more human-readable backtrace.
4. Provoke the error again.

You can now report the problem to the package maintainer.  If the
responsible code is delivered as part of Emacs (not some 3rd party)
then report the problem to Emacs Dev using `M-x report-emacs-bug'.

If you want to debug it further yourself, step through the debugger
after step #4 above.  Use `d' to single-step and `c' to skip through
a step.  Use `q' to quit or step through until the problematic
function returns.

Some people prefer `edebug' to `debug'.  I prefer `debug', which is
what you get with the above recipe.



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

* Re: Wrong type argument: arrayp, nil
       [not found] <mailman.19942.1398016221.10748.help-gnu-emacs@gnu.org>
@ 2014-04-20 18:17 ` Pascal J. Bourguignon
  0 siblings, 0 replies; 5+ messages in thread
From: Pascal J. Bourguignon @ 2014-04-20 18:17 UTC (permalink / raw)
  To: help-gnu-emacs

Gracjan Polak <gracjanpolak@gmail.com> writes:

> Hi,
>
> I'm not sure if this is the correct place, I suspect it is not so please
> forward me where to go.
>
> So I was happily hacking on something totally other when my language
> indentation mode after a TAB responded with friendly: Wrong type argument:
> arrayp, nil.
>
> Being ambitious programmer as I am I decided to debug the issue in the
> indentation package that I use.


M-x set-variable RET debug-on-error RET t RET

then try again.

Next time you get an error, emacs will produce a *Backtrace* buffer
listing all the embeded function calls with the arguments.  You can skip
to the sources of the function calls to further debug.


-- 
__Pascal Bourguignon__
http://www.informatimago.com/
"Le mercure monte ?  C'est le moment d'acheter !"


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

* Re: Wrong type argument: arrayp, nil
  2014-04-20 18:16 ` Drew Adams
@ 2014-04-20 18:25   ` Gracjan Polak
  2014-04-20 21:00     ` Drew Adams
  0 siblings, 1 reply; 5+ messages in thread
From: Gracjan Polak @ 2014-04-20 18:25 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs

Thanks, that got me started.

Is there a debug tutorial somewhere or d and c and q is all that is needed
in real life?

How does you debug-edit-debug cycle look like? Is C-x C-e all I should be
using or is there something that has a concept of 'a breakpoint'?



2014-04-20 20:16 GMT+02:00 Drew Adams <drew.adams@oracle.com>:

> First, do this, to get a human-readable backtrace:
>
> 1. Set variable `debug-on-error' to t.
> 2. Provoke the error, so you can see which function is problematic.
>    Quit the debugger using `q'.
> 3. Load the source files for the package in question.  This is to
>    give you a more human-readable backtrace.
> 4. Provoke the error again.
>
> You can now report the problem to the package maintainer.  If the
> responsible code is delivered as part of Emacs (not some 3rd party)
> then report the problem to Emacs Dev using `M-x report-emacs-bug'.
>
> If you want to debug it further yourself, step through the debugger
> after step #4 above.  Use `d' to single-step and `c' to skip through
> a step.  Use `q' to quit or step through until the problematic
> function returns.
>
> Some people prefer `edebug' to `debug'.  I prefer `debug', which is
> what you get with the above recipe.
>


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

* RE: Wrong type argument: arrayp, nil
  2014-04-20 18:25   ` Gracjan Polak
@ 2014-04-20 21:00     ` Drew Adams
  0 siblings, 0 replies; 5+ messages in thread
From: Drew Adams @ 2014-04-20 21:00 UTC (permalink / raw)
  To: Gracjan Polak; +Cc: help-gnu-emacs

> Is there a debug tutorial somewhere or d and c and q is all that is needed
> in real life?

See the Elisp manual, node `Using Debugger'.  See in fact all of the nodes
under node `Debugger'.

> How does you debug-edit-debug cycle look like? Is C-x C-e all I should be
> using or is there something that has a concept of 'a breakpoint'?

You can place an explicit call to `debug' in the source code (or a copy
of the source code, anywhere you like.  That makes the debugger enter at
that point.



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

end of thread, other threads:[~2014-04-20 21:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-20 17:44 Wrong type argument: arrayp, nil Gracjan Polak
2014-04-20 18:16 ` Drew Adams
2014-04-20 18:25   ` Gracjan Polak
2014-04-20 21:00     ` Drew Adams
     [not found] <mailman.19942.1398016221.10748.help-gnu-emacs@gnu.org>
2014-04-20 18:17 ` Pascal J. Bourguignon

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.