Commit b95ddab3 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(dired-get-filename): Add /: when appropriate

to avoid taking a local name as remote.
parent c736f678
......@@ -1425,14 +1425,25 @@ Optional arg NO-ERROR-IF-NOT-FILEP means return nil if no filename on
(not default-file-name-coding-system)
(setq file (encode-coding-string file buffer-file-coding-system)))
((null file)
((eq localp 'verbatim)
((and (eq localp 'no-dir) already-absolute)
(file-name-nondirectory file))
((or already-absolute (eq localp 'no-dir))
(if (find-file-name-handler file nil)
(concat "/:" file)
((eq localp 'no-dir)
((equal (dired-current-directory) "/")
(setq file (concat (dired-current-directory localp) file))
(if (find-file-name-handler file nil)
(concat "/:" file)
(and file (concat (dired-current-directory localp) file))))))
(concat (dired-current-directory localp) file)))))
(defun dired-string-replace-match (regexp string newtext
&optional literal global)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment