Skip to content

[mu4e] Catch errors when loading org #16953

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 13, 2025

Conversation

fnussbaum
Copy link
Collaborator

An error within (with-eval-after-load 'org ...) has severe consequences: Org fails to load, and also help buffers cannot be opened at all, due to the elisp-demos package requiring org.

An error within `(with-eval-after-load 'org ...)` has severe consequences:
Org fails to load, and also help buffers cannot be opened at all, due to the
elisp-demos package requiring org.
@bcc32
Copy link
Collaborator

bcc32 commented Apr 11, 2025

What error from mu4e did you see here?

Because of #16871 I'm a little wary of introducing uses of
with-demoted-errors; shouldn't the user just be made to see the
error and either debug it or disable mu4e-org-link-support?

@fnussbaum
Copy link
Collaborator Author

This raises an error when mu4e is not properly installed, but the layer is added, for example.

Because of #16871 I'm a little wary of introducing uses of
with-demoted-errors;

Fair point, but I'd actually like to catch even more errors (see #16952), at least on startup, where they often make Spacemacs completely unusable. I think having to set debug-on-error to get a backtrace in some more cases is an acceptable trade-off for having a usable editor, which can be used to investigate, solve, or report those startup errors. (For me personally, at least, encountering uncaught errors on startup has been a common source of frustration in the past.)

Also, in this case the error usually occurs (or can easily be reproduced) during a session, which means toggle-debug-on-error will produce a backtrace.

shouldn't the user just be made to see the
error and either debug it or disable mu4e-org-link-support?

With this change, the user should still see the error; but I can make it even more visible by using configuration-layer//error which would make it show up on the Spacemacs buffer, if you prefer. I don't think we should "artificially" make errors more severe by letting them break unrelated functionality such as in this case.

@bcc32
Copy link
Collaborator

bcc32 commented Apr 13, 2025

Ah, right, I misunderstood and now realize that this error does not actually occur at startup but instead afterwards. LGTM.

@bcc32 bcc32 merged commit 72b8c64 into syl20bnr:develop Apr 13, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants