unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Jarek Czekalski <jarekczek@poczta.onet.pl>, 15670@debbugs.gnu.org
Subject: bug#15670: 24.3; dummy user-errors on info nodes without prev/next nodes
Date: Mon, 21 Oct 2013 09:43:05 -0700 (PDT)	[thread overview]
Message-ID: <4235086e-f6e7-4479-babc-261b464152ee@default> (raw)
In-Reply-To: <526548F4.3040601@poczta.onet.pl>

> Expected behaviour: no user-errors should be generated, when user
> makes no errors.

Here's the problem: For Emacs Dev, a regular (i.e., non-user) "error"
means something is wrong with the program itself or something
unexpected happened, such as a disk problem.  "User error" is more or
less left as a catch-all, for behavior that the program expects.

Emacs provides for such a "user" error by ending the dialog with an
error message - it is one step beyond just calling `message' and
ending the current command.

The name `user-error' thus does not really correspond to pilot error.
This is what the doc says about `user-error':

"[It is] intended to report errors on the part of the user, rather
than errors in the code itself."

Or as Stefan put it, a user error is "A error of the user rather than
of the author of the code."

As almost anyone can tell, this is a false dichotomy.  An error does
not necessarily fall into one of those two camps.

And that is the explanation for what you are seeing: Because the
error you reported is not considered to be an "error in the code
itself", by process of elimination it is considered to be a "user
error".

Which of course it is not, really.

The doc continues with an example which is very close to the one
you cited:

  For example, if you
  try to use the command `Info-history-back' (`l') to move back
  beyond the start of your Info browsing history, Emacs signals a
  `user-error'.

And then the doc gives you the _real_ difference, in terms not of
name or described meaning, but of what the _behavior_ is:

  Such errors do not cause entry to the debugger,
  even when `debug-on-error' is non-`nil'.

That's the real difference.  Should the error you cite cause entry
to the debugger?  That's the only question to be posed here.  If so
then `user-error', in spite of the unfortunate name, is appropriate.

This should have been called a different name that reflects the real
meaning, and the description not should say anything about "user error"
or "errors on the part of the user".

This was all discussed at the time `user-error' was added.  We are
living with that decision.

Here is the discussion thread:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11999#35.

Highlights:

"[In] this particular use case (and perhaps others? it seems that `error'
 was nearly systematically replaced with `user-error' in info.el) is
 inappropriate.  At least according to the stated purpose of `user-error' -
 this is not at all "pilot error"."

"[W]hat do you think is the
 correct way to signal to a user that the term s?he tried to look up is not in
 the index?  Is it `message'?  `message' + `ding'?  `error' (as always,
 previously)?  `user-error'?  something else?

 If it is `user-error' then I think the doc needs to be changed to correct the
 stated aim of `user-error'.  If it is not `user-error' then maybe the code needs
 to be checked generally for additional places where the purpose of `user-error'
 might not have been respected."

"(Most (>99%) uses of `error' have had nothing to do with trying to signal a
 problem of the code itself.  IOW, `error' is not used often just for
 this-should-never-happen errors (debugging).  But that's the impression I get
 from the `user-error' doc: that `user-error' is not intended to signal a
 programming problem, which suggests that `error' might be intended for that.)

 Two things matter: (1) what the actual behavior is in a given context, and
 whether it is useful/appropriate, (2) what the stated use of `user-error' is,
 and whether actual uses correspond to it.  To me, #1 is generally more
 important."

"It _looks_ (with just a glance) like someone blanket-replaced `error' with
 `user-error' in info.el (and elsewhere?).  That cannot be right, _if_ the stated
 purpose of `user-error' is correct."

"And perhaps other files were also subjected to such a wholesale replacement.
 This kind of change requires time, analysis, & judgment.  The person making the
 change at any given occurrence needs to read, understand the code, and
 (especially) think of the user."

"[T]hat description is a false, binary choice.  The same false choice is
 presented by "A error of the user rather than of the author of the code."  There
 are uses of error signaling (and more generally, alerting the user and perhaps
 returning to top level) that are neither.

 IOW, there is a lot that is neither an error by the user nor a mistake in the
 code.  Without clarifying the doc & design wrt this middle ground, we will
 continue to (a) confuse users and (b) have inappropriate uses of either `error'
 or `user-error'."

"> I already explained it: user-error is for errors which are 
 > not caused by bugs in the code (i.e. they're caused by
 > manipulation mistakes, or problems in the environment such
 > as missing files, ...).

 So it is instead the behavior of `error' that you are defining in a
 clear way, and `user-error' that is the catchall: everything else.

 Given that approach, I would propose these names:

 * `code-error': errors that indicate a bug in the code
 * `other-error': any other error"

">> >> Note that most uses of `user-error' are correct in that they signal
 >> >> conditions which are usually simply due to a mistaken manipulation
 >> >> (such as trying to move past the EOB)
 >> >
 >> > That's a coincidence: we tend to want the no-debug behavior for user
 >> > errors.  Bu the feature is not about user errors, it's about not
 >> > entering the debugger.
 >>
 >> No, it's not just a coincidence: if the problem is not due to the author
 >> of the code having made a mistake, then it can basically only be due to
 >> a mistake of the user in its larger sense (which includes the steps the
 >> user or his sysadmin did to set up the system).
 >
 > Let's take the use case of typing "i foobar" and getting "No 'foobar'
 > in index." in response.  Whose fault/mistake is this?

 I think it is clearly a "user error.  - Stefan"

"I give up. - Eli"

(Drew gave up sometime before that point.)





  parent reply	other threads:[~2013-10-21 16:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-21 15:32 bug#15670: 24.3; dummy user-errors on info nodes without prev/next nodes Jarek Czekalski
2013-10-21 15:52 ` bug#15670: how advised Jarek Czekalski
2013-10-21 16:43 ` Drew Adams [this message]
2013-10-21 17:16 ` bug#15670: 24.3; dummy user-errors on info nodes without prev/next nodes Stefan Monnier
2013-10-22  1:17   ` Michael Heerdegen
2013-10-22  5:47     ` Michael Heerdegen
2013-10-22  7:15       ` Jarek Czekalski
2013-10-23  7:51         ` Michael Heerdegen
2013-10-21 18:22 ` bug#15670: i'll try to get more info Jarek Czekalski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4235086e-f6e7-4479-babc-261b464152ee@default \
    --to=drew.adams@oracle.com \
    --cc=15670@debbugs.gnu.org \
    --cc=jarekczek@poczta.onet.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).