bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#11999: 24.1.50; New Info file suffix ".info" breaks `Info-find-node-


From: Drew Adams
Subject: bug#11999: 24.1.50; New Info file suffix ".info" breaks `Info-find-node-2'
Date: Sun, 22 Jul 2012 07:34:29 -0700

> > Stefan, could you perhaps provide some insight?  What is a "pilot
> > error" in this context,
> 
> A error of the user rather than of the author of the code.

Yes, that's what I understood by "pilot error" (the former part: an error by the
user).

That is not what is going on when a user looks up a term that does not happen to
be in the index (which is what this bug report was about).  The user is doing
nothing wrong there.

And I'm guessing, without checking in detail and based only on the fact that so
many calls to `error' were changed to `user-error' in info.el, that there might
be additional inappropriate uses of `user-error' in info.el - perhaps many of
them.

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.

> > and how should Lisp programs use this new facility to (supposedly)
> > provide better diagnostics and/or better error handling?
> 
> user-error is just a standard "debug-ignored-error".  So instead of
> using error plus adding the text of the error to debug-ignored-errors,
> you can just user user-error.
> 
> If Drew gets a user-error that drops him in the debugger, it's because
> he removed` user-error' from debug-ignored-errors.

Not really.  C-h v debug-ignored-errors:

,----
| debug-ignored-errors is a variable defined in `C source code'.
| Its value is
| (search-failed "^Invalid face:? " beginning-of-line beginning-of-buffer
end-of-line end-of-buffer end-of-file buffer-read-only file-supersession
user-error)
| 
| Original value was 
| (beginning-of-line beginning-of-buffer end-of-line end-of-buffer end-of-file
buffer-read-only file-supersession user-error)
|
...
`----

[BTW, as you can see, that value is printed too wide - 158 chars wide!.  It
should be limited (pretty-printed with filling to the usual max width), in line
with the rest of a *Help* buffer.]

And a quick test shows that use of `user-error' does not enter the debugger for
me, whereas use of `error' does.  So there must be something else going on here.

But I just tried the original recipe again, and now it does not enter the
debugger.  I've tried to see what I might have changed locally in the meantime,
but I haven't found anything yet.  I have not changed `debug-ignored-errors', of
that I am certain.

At any rate, let's not worry for this bug about whether the debugger is entered.
That can be discussed later if necessary, and I have already said that I do not
have an opinion about whether it should be entered for such an error (i.e., like
this one in Info).

The real questions for this bug are (1) whether all of the occurrences of
`user-error' in info.el are appropriate (in particular, the one for index
lookup) and (2) whether the doc about `user-error' is accurate and clear.

> >> An index lookup that finds no hit is NOT "expected to be 
> >> the result of an incorrect manipulation on the part of
> >> the user, rather than the result of an actual problem." 
> 
> By "actual problem", I meant "a bug in the code", i.e. a problem that
> can be fixed by correcting the code.

That too is what I guessed, at least the latter part: a coding mistake.

But that 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'.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]