On Sun, Jan 24, 2016 at 1:48 PM, Michael Albinus <michael.albinus@gmx.de> wrote:
Ken Manheimer <ken.manheimer@gmail.com> writes:

[...] 
But the "Selecting deleted buffer" error is hidden very well, likely by
an `ignore-errors' wrapper. And debugging changes the behaviour.

Ignore-errors wrappers are often not sufficiently thought through. An idea I've often had is that code which legitimately is not interrupted by errors is therefore, inherently, acting as a kind of "executive", responsible for running code for something else. (Some common examples are read-eval-print loops, more sophisticated ones are RPC services, interpreters, dev tools like debuggers and profilers, etc.) While the executive needs to continue, the part that's often insufficiently tended is a responsibility to convey the error to the parties for which it's running the code, so they can react accordingly.

That's a pretty darn abstract assessment, though, very vague about what "convey the error" means.  In this case, it may just mean indicating more about the code context where the error occurred, so that someone debugging the problem has more leads to track it down. A language that I like for this kind of thing, Python, provides library calls which expose the traceback context, so that info can be explicitly included. Not sure if emacs lisp has similar facilities.

Ken

> Interesting that changing tramp-verbose avoids the problem. Sounds
> like that, in itself, might be a lead on the problem?

My guess is it is related to Tramp's debug buffer (it won't be touched
when tramp-verbose is less than 3). I'll continue to dig.

> Ken

Best regards, Michael.