Good job tracking that down - thanks much!

I may not be able to examine it soon, but will keep alert for problems. Using `cd' instead of changing default-directory is proving to be a decent workaround, worth sticking with since that means my package can work with emacs 24 (and 23, for that matter).

On Thu, Jan 28, 2016 at 7:45 AM, Michael Albinus <michael.albinus@gmx.de> wrote:
Version: 25.1

Ken Manheimer <ken.manheimer@gmail.com> writes:

> I'm glad you're investigating, Michael!
>
> Upshot is that I believe that there still is a bug worth unravelling
> [especially since it involves an aggravating and elusive "Selecting
> deleted buffer" event], in the way that shells start when
> default-directory is set to remote+sudo+homedir format, but I can
> avoid that by using `cd'.

Finally, I could fix it. While establishing the connection, a
`file-remote-p` call was performed which included `expand-file-name' of
`default-directory'. Since the connection wasn't stablished yet, the
error occured.

There won't be a new Emacs 24.x release, so I have fixed it in Emacs
25.1 (commit deae005667516b7e1296527f7e34c54604a81882). You could check
it there. In case of problems, pls tell.

> Ken

Best regards, Michael.