diff options
| author | Paul Eggert | 2017-08-29 19:17:54 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-08-29 19:18:38 -0700 |
| commit | 70bb510a7eb1a3010cfa034884b7e5ab2063ece3 (patch) | |
| tree | 1be6cb843782bf1389850cc3589e7c22109646d9 | |
| parent | 0001ff27c4a114fdfe75c8e35b0970ecd939a53d (diff) | |
| download | emacs-70bb510a7eb1a3010cfa034884b7e5ab2063ece3.tar.gz emacs-70bb510a7eb1a3010cfa034884b7e5ab2063ece3.zip | |
Prefer file-name-quote to concat "/:"
Suggested by Michael Albinus (Bug#28264#13).
* lisp/files.el (files--splice-dirname-file): Use file-name-quote
rather than attempting to do it by hand.
| -rw-r--r-- | lisp/files.el | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/files.el b/lisp/files.el index 5f55aa75a70..7754be29643 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -1156,16 +1156,16 @@ names beginning with `~'." | |||
| 1156 | (defun files--splice-dirname-file (dirname file) | 1156 | (defun files--splice-dirname-file (dirname file) |
| 1157 | "Splice DIRNAME to FILE like the operating system would. | 1157 | "Splice DIRNAME to FILE like the operating system would. |
| 1158 | If FILENAME is relative, return DIRNAME concatenated to FILE. | 1158 | If FILENAME is relative, return DIRNAME concatenated to FILE. |
| 1159 | Otherwise return FILE, quoted with `/:' if DIRNAME and FILE have | 1159 | Otherwise return FILE, quoted as needed if DIRNAME and FILE have |
| 1160 | different handlers; although this quoting is dubious if DIRNAME | 1160 | different handlers; although this quoting is dubious if DIRNAME |
| 1161 | is remote, it is not clear what would be better. This function | 1161 | is magic, it is not clear what would be better. This function |
| 1162 | differs from `expand-file-name' in that DIRNAME must be a | 1162 | differs from `expand-file-name' in that DIRNAME must be a |
| 1163 | directory name and leading `~' and `/:' are not special in FILE." | 1163 | directory name and leading `~' and `/:' are not special in FILE." |
| 1164 | (if (files--name-absolute-system-p file) | 1164 | (if (files--name-absolute-system-p file) |
| 1165 | (if (eq (find-file-name-handler dirname 'file-symlink-p) | 1165 | (if (eq (find-file-name-handler dirname 'file-symlink-p) |
| 1166 | (find-file-name-handler file 'file-symlink-p)) | 1166 | (find-file-name-handler file 'file-symlink-p)) |
| 1167 | file | 1167 | file |
| 1168 | (concat "/:" file)) | 1168 | (file-name-quote file)) |
| 1169 | (concat dirname file))) | 1169 | (concat dirname file))) |
| 1170 | 1170 | ||
| 1171 | (defun file-truename (filename &optional counter prev-dirs) | 1171 | (defun file-truename (filename &optional counter prev-dirs) |