diff options
Diffstat (limited to 'lisp/files.el')
| -rw-r--r-- | lisp/files.el | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/lisp/files.el b/lisp/files.el index 2b1446683be..e099d30a01f 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -540,13 +540,21 @@ is a valid DOS file name, but c:/bar/c:/foo is not. | |||
| 540 | 540 | ||
| 541 | This function's standard definition is trivial; it just returns | 541 | This function's standard definition is trivial; it just returns |
| 542 | the argument. However, on Windows and DOS, replace invalid | 542 | the argument. However, on Windows and DOS, replace invalid |
| 543 | characters. On DOS, make sure to obey the 8.3 limitations. On | 543 | characters. On DOS, make sure to obey the 8.3 limitations. |
| 544 | Windows, turn Cygwin names into native names, and also turn | 544 | In the native Windows build, turn Cygwin names into native names, |
| 545 | slashes into backslashes if the shell requires it (see | 545 | and also turn slashes into backslashes if the shell requires it (see |
| 546 | `w32-shell-dos-semantics'). | 546 | `w32-shell-dos-semantics'). |
| 547 | 547 | ||
| 548 | See Info node `(elisp)Standard File Names' for more details." | 548 | See Info node `(elisp)Standard File Names' for more details." |
| 549 | filename) | 549 | (if (eq system-type 'cygwin) |
| 550 | (let ((name (copy-sequence filename)) | ||
| 551 | (start 0)) | ||
| 552 | ;; Replace invalid filename characters with ! | ||
| 553 | (while (string-match "[?*:<>|\"\000-\037]" name start) | ||
| 554 | (aset name (match-beginning 0) ?!) | ||
| 555 | (setq start (match-end 0))) | ||
| 556 | name) | ||
| 557 | filename)) | ||
| 550 | 558 | ||
| 551 | (defun read-directory-name (prompt &optional dir default-dirname mustmatch initial) | 559 | (defun read-directory-name (prompt &optional dir default-dirname mustmatch initial) |
| 552 | "Read directory name, prompting with PROMPT and completing in directory DIR. | 560 | "Read directory name, prompting with PROMPT and completing in directory DIR. |
| @@ -4369,7 +4377,7 @@ See also `auto-save-file-name-p'." | |||
| 4369 | "#"))) | 4377 | "#"))) |
| 4370 | ;; Make sure auto-save file names don't contain characters | 4378 | ;; Make sure auto-save file names don't contain characters |
| 4371 | ;; invalid for the underlying filesystem. | 4379 | ;; invalid for the underlying filesystem. |
| 4372 | (if (and (memq system-type '(ms-dos windows-nt)) | 4380 | (if (and (memq system-type '(ms-dos windows-nt cygwin)) |
| 4373 | ;; Don't modify remote (ange-ftp) filenames | 4381 | ;; Don't modify remote (ange-ftp) filenames |
| 4374 | (not (string-match "^/\\w+@[-A-Za-z0-9._]+:" result))) | 4382 | (not (string-match "^/\\w+@[-A-Za-z0-9._]+:" result))) |
| 4375 | (convert-standard-filename result) | 4383 | (convert-standard-filename result) |
| @@ -4404,7 +4412,7 @@ See also `auto-save-file-name-p'." | |||
| 4404 | ((file-writable-p default-directory) default-directory) | 4412 | ((file-writable-p default-directory) default-directory) |
| 4405 | ((file-writable-p "/var/tmp/") "/var/tmp/") | 4413 | ((file-writable-p "/var/tmp/") "/var/tmp/") |
| 4406 | ("~/"))))) | 4414 | ("~/"))))) |
| 4407 | (if (and (memq system-type '(ms-dos windows-nt)) | 4415 | (if (and (memq system-type '(ms-dos windows-nt cygwin)) |
| 4408 | ;; Don't modify remote (ange-ftp) filenames | 4416 | ;; Don't modify remote (ange-ftp) filenames |
| 4409 | (not (string-match "^/\\w+@[-A-Za-z0-9._]+:" fname))) | 4417 | (not (string-match "^/\\w+@[-A-Za-z0-9._]+:" fname))) |
| 4410 | ;; The call to convert-standard-filename is in case | 4418 | ;; The call to convert-standard-filename is in case |