;;; Fontification of `read-file-name':
-(defvar tramp-rfn-eshadow-overlay)
-(make-variable-buffer-local 'tramp-rfn-eshadow-overlay)
+;; An overlay covering the shadowed part of the filename (local to the
+;; minibuffer).
+(defvar-local tramp-rfn-eshadow-overlay nil)
(defun tramp-rfn-eshadow-setup-minibuffer ()
"Set up a minibuffer for `file-name-shadow-mode'.
(minibuffer-prompt-end)))
;; We do not want to send any remote command.
(non-essential t))
- (when (tramp-tramp-file-p (buffer-substring end (point-max)))
+ (when (and (tramp-tramp-file-p (buffer-substring end (point-max)))
+ (not (file-name-quoted-p (buffer-substring end (point-max)))))
(save-excursion
(save-restriction
(narrow-to-region
;; Otherwise, remove any trailing slash from localname component.
;; Method, host, etc, are unchanged.
(while (with-parsed-tramp-file-name directory nil
+ (setq localname (file-name-unquote localname))
(and (length> localname 0)
(eq (aref localname (1- (length localname))) ?/)
(not (string= localname "/"))))
(eq (file-attribute-type (file-attributes (file-truename filename))) t)))
(defun tramp-handle-file-equal-p (filename1 filename2)
- "Like `file-equalp-p' for Tramp files."
- ;; Native `file-equalp-p' calls `file-truename', which requires a
+ "Like `file-equal-p' for Tramp files."
+ ;; Native `file-equal-p' calls `file-truename', which requires a
;; remote connection. This can be avoided, if FILENAME1 and
;; FILENAME2 are not located on the same remote host.
(when (tramp-equal-remote