Malabarba / elisp-bug-hunter

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

Does bug-hunter not properly escape "? #25

Closed antifuchs closed 4 years ago

antifuchs commented 4 years ago

I'm trying to find a bug in my init file where opening an org-mode file with a particular set of OPTIONS fails, and am using this assertion:

(with-temp-buffer
  (require 'org)
  (insert "\"#+OPTIONS: H:1 num:t\"")
  (condition-case nil (progn (org-mode) (org-end-of-line) nil) (error t)))

This expression succeeds when run manually on an emacs -Q, and fails in the current instance (and a freshly-booted emacs). The error message that bug-hunter gives me shows me this assertion though:


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
(with-temp-buffer (require (quote org)) (insert #+OPTIONS: H:1 num:t) (condition-case nil (progn (org-mode) (org-end-of-line) nil) (error t)))

I'm not sure if this is just a bug in printing the error, or if it's actually related to the assertion failing when run by bug-hunter & succeeding when run manually.

antifuchs commented 4 years ago

Turns out that this wasn't the case: The problem here was the org element cache, for some reason. I'll close this, it seems it's just the error message that's confusing.