Subject: 27.0.50; Remote file handling is broken

From: Stephen Berman <[email-masked]>
Date: Thu, 30 Nov 2017 00:34:33 +0100

0. emacs -Q
1. Evaluating this sexp: (dired "/su::/var/log")
   fails to prompt for root's password and errors with this backtrace:

Debugger entered--Lisp error: (error "Directory /su::/var/log inaccessible or nonexistent")
  signal(error ("Directory /su::/var/log inaccessible or nonexistent"))
  error("Directory %s inaccessible or nonexistent" "/su::/var/log")
  dired-readin-insert()
  dired-readin()
  dired-internal-noselect("/su::/var/log" nil)
  dired-noselect("/su::/var/log" nil)
  dired("/su::/var/log")
  eval((dired "/su::/var/log") nil)
  elisp--eval-last-sexp(t)
  eval-last-sexp(t)
  eval-print-last-sexp(nil)
  funcall-interactively(eval-print-last-sexp nil)
  call-interactively(eval-print-last-sexp nil nil)
  command-execute(eval-print-last-sexp)

A similar failure happens when trying to access a real remote file via
e.g. sftp, except that the error is `file-missing "Setting current
directory" "No such file or directory"'.

The failure happens when dired-insert-directory calls
(file-remote-p "/su::/var/log")
, which calls 
(find-file-name-handler "/su::/var/log" 'file-remote-p)
, and both of these return nil.

The failure does not happen in emacs-26; there 
(file-remote-p "/su::/var/log") 
returns 
#("/su:root@rosalinde:" 4 8 (tramp-default t))
and 
(find-file-name-handler "/su::/var/log" 'file-remote-p) 
returns
tramp-file-name-handler

I bisected the failure to this commit:

commit 0f286ca85a259575b67dba520ff72e59cc011426
Author: Michael Albinus <[email-masked]>
Date:   Sat Oct 21 18:51:25 2017 +0200

  Fix Bug#28889
  
  * lisp/net/tramp.el: Change autoload cookie to tramp-autoload cookie.
  (tramp-completion-file-name-regexp-default)
  (tramp-completion-file-name-handler-alist)
  (tramp-completion-file-name-handler): Remove autoload cookie.
  (tramp-initial-completion-file-name-regexp): Remove.
  (tramp-autoload-file-name-regexp): New defconst.
  (tramp-register-autoload-file-name-handlers): Use it.
  (with-parsed-tramp-file-name): Adapt docstring.  Compute
  `tramp-file-name' slots.  (Bug#28889)

This commit is also in emacs-26, so it would seem that some later commit
to emacs-26 fixed it and this hasn't been merged to master.  I bisected
on master between 090f4f157eea6f0d0d13963520f5e05706de142f, which is my
last build on master where the failure does not occur, and
83dc3f0e9b518e45bcfb0aaebcc706f79622f157, which is my first build on
master where the failure does occur.  (It's too late for me to bisect on
emacs-26 now; if necessary, I can try to do it in the next few days.)

In GNU Emacs 27.0.50 (build 10, x86_64-pc-linux-gnu, GTK+ Version 3.22.18)
 of 2017-11-29 built on rosalinde
Repository revision: 95369ac346d75a7b75bc2c5adf632cc4faa1241a
Windowing system distributor 'The X.Org Foundation', version 11.0.11903000master/
System Description:	Linux From Scratch

Recent messages:
Reading active file from private via nnfolder...
Opening nnfolder server on private...done
Reading incoming mail from file...
nnfolder: Reading incoming mail (no new mail)...done
Reading active file from private via nnfolder...done
Reading active file from archive via nnfolder...
Opening nnfolder server on archive...done
Reading active file from archive via nnfolder...done
Reading active file via nndraft...done
Checking new news...done
Quit
Configured using:
 'configure --with-xwidgets 'CFLAGS=-Og -g3''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11 XWIDGETS LCMS2

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix