[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Short patch for review
From: |
Stefan Monnier |
Subject: |
Re: Short patch for review |
Date: |
Thu, 19 Feb 2015 08:44:20 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
> Do we have guidelines for which errors should be 'user-error'?
The idea is that if an error is normally not the result of an Elisp bug
but a "pilot error", we should use `user-error' so that users who set
debug-on-error to t don't get dropped into the debugger when they hit
this signal.
Now, in practice, I think most/all places where we signal an error can
sometimes be due to a pilot error and sometimes due to a bug in Elisp.
So it's a judgment call.
I wish we could have a more reliable way to handle that.
To the best of my knowledge we *could* do better by indicating for those
"user-error" a condition under which this should be treated as a "pilot
error", and this condition usually looks like "we're called from
function <foo> and that function was called interactively".
E.g. if forward-sexp bumps into EOB it's a user-error when forward-sexp
was called interactively, but it's a normal error otherwise.
But of course, if forward-sexp was called from a wrapper which itself
was called interactively it might still be a user-error.
IOW doing it right automatically is pretty much impossible.
So we're currently stuck with this judgment call.
Stefan