On Jul 28, 2016 05:34, Michael Albinus <michael.albinus@gmx.de> wrote:
> I doubt that you could reuse much of Tramp's `process-file'
> implementations. They use pretty much Tramp internal functions.

Not sure what you mean. I didn't hope to reuse TRAMP implementation,
just to use process-file which so many other Elisp programs have
changed their implementation to use.

> Btw, this approach could still be applied to remote files. File name
> handler calls can be cascaded.
>
> "/?my-environment?~/.emacs" would work on a local file, and
> "/?my-environment?~/sudo::.emacs" would work on a remote file.

Yes, this is a possible future development. It might even work
automatically if magic prefixes are stripped one by one, and TRAMP
uses process-file internally. (Not sure what TRAMP internals
look like)