Malabarba / elisp-bug-hunter

Hunt down errors in elisp files.
275 stars 15 forks source link

How to debug a user-error when calling helm-imenu #19

Closed fniessen closed 5 years ago

fniessen commented 8 years ago

Hello, wanted to try this very, very, very promising package!

However, got some troubles.

Tried M-x bug-hunter-file RET emacs-leuven.el (my init file, on GitHub)

Then tried the assertion (progn (find-file "~/test.java") (helm-imenu)) (see https://github.com/emacs-helm/helm/issues/1547 for test.java, if you're interested)

But:

How could I debug this helm-imenu problem?

Best regards!

Malabarba commented 8 years ago

Thanks for trying it out. :-)

the bug hunter told me my assertion wasn't good enough (not returning nil in normal cases); though, I wonder how I should rewrite it; and it told me to try the interactive version

Try using this for the assertion: (progn (find-file "~/test.java") (helm-imenu) nil)

in the interactive version, I got a frame launched, in which the problem does not appear (!) and which I couldn't close... So, I was blocked at that point.

Why couldn't you close the frame? C-x C-c didn't work?

fniessen commented 8 years ago

OK, I'll try your assertion. Simple add-on! Maybe you could add such a case in your doc...

Regarding closing the frame, my whole Emacs was stuck. I've needed to kill it via the Task Manager.

fniessen commented 8 years ago

Tried your assertion, but still got:

Doing some initial tests...
Test failed.
Assertion returned non-nil even on emacs -Q:Remember, the assertion must be an expression that
returns
non-nil in your current (problematic) Emacs state, AND that
returns nil on a clean Emacs instance.
If you're unsure how to write an assertion, you can try the interactive
hunt instead, or see some examples in the Readme:
    https://github.com/Malabarba/elisp-bug-hunter
(progn (find-file ~/test.java) (helm-imenu) nil)

Regarding trying it out, of course I do: I need such a tool in my daily Emacs live! (and I'm clearly not alone ;-))

Malabarba commented 8 years ago

Oops, forgot somethng. :-) Try this instead:

(progn (find-file "~/test.java")
       (require 'helm-imenu)
       (helm-imenu)
       nil)