2
votes

I'm having a problem with an Emacs lisp package that I pulled down from the ubuntu distribution. The package is JDEE, and it complains of Args out of range: "63", 0, 4 in the mini buffer and the *Messages* buffer whenever I open a file. This bug appears to have been reported last September but no action has been taken. I'm not an emacs newbie, having written some Elisp code myself, but I've never attempted to debug anything like this. I would like to stop the file load in a debugger when this error happens to at least get an idea of where the problem is coming from. I've read section 18.1.1 of the Elisp manual on "Entering the debugger on error" but trying to load the file after playing with various combinations of values for debug-on-error, debug-ignored-errors, and debug-on-signal appears to have no effect. Has anybody got any suggestions for my next step?

3
Could you tell which Emacs version do you use, and how do you open a file (with command, keystroke or menubar item)?viam0Zah
I'm the one who reported this bug in Launchpad. Would you mind adding a "me too" over there, so maybe the maintainers will pay attention? bugs.launchpad.net/ubuntu/+source/cedet/+bug/264498Chris Conway
Of course, submitting a patch would be fine too ;-)Chris Conway
slink: emacs is 22.1.1, and I open with find-file, which is bound to [C-x C-f] Chris: added my report to yours. Did you ever hear anything back on this?user98166
Chris: I think I may have made a tiny bit of headway on this, do you perchance have '(jde-jdk (quote ("53"))) in the custom-set-variables of your .emacs?user98166

3 Answers

7
votes

If debug-on-error isn't working, I'd start with the source itself. Find the keybinding/event that is causing the problem, and locate the function.

C-h k <keystrokes>
M-x find-function <function-name-from-above>

Now, once you are at the source

M-x edebug-defun

And the next time you hit the key, you should be able to step through the program. At that point, you can see which portion causes an error - and drill down that way.

You can also try setting the variable 'stack-trace-on-error to see if you can find the culprit (though 'debug-on-error usually works for me, not sure why it doesn't for you).

As a last resort (if edebug-defun doesn't work), you can redefine the routine with a call to (debug) in it, sort of does the same.

0
votes

I suppose JDEE is somehow inhibiting debug-on-error. Perhaps grep through its files for the error message "Args out of range". While debugging, make sure to load the uncompiled .el files, not the byte-compiled .elc files (you will notice it in the debugger if you are running byte-compiled code) by entering commands like (load "foo.el") instead of (load "foo").

-1
votes

I got the same error when using find-grep after accidentally redefining (current-time-string) in one of my own scripts.

Using the M-x edebug-defun tip posted above I managed to find the issue when I stepped through the code giving the error seeing the call to (current-time-string).

Not sure how helpful this is in your case.