diff options
| author | Geoff Voelker | 1997-09-02 19:38:31 +0000 |
|---|---|---|
| committer | Geoff Voelker | 1997-09-02 19:38:31 +0000 |
| commit | b1667e6c861b23b17667bdfaa1a06b9a6042b5af (patch) | |
| tree | d7fabc696e0aa33df5df68a8fee3a08bfd9903fd | |
| parent | 586a96b83f8b56626b016550b3481c7a512e7080 (diff) | |
| download | emacs-b1667e6c861b23b17667bdfaa1a06b9a6042b5af.tar.gz emacs-b1667e6c861b23b17667bdfaa1a06b9a6042b5af.zip | |
(file-truename) [windows-nt]: Use the canonicalized
long file name as the truename.
(auto-mode-alist): Use archive-mode for Java JAR files.
(recover-file) [windows-nt]: Don't try to list directory.
| -rw-r--r-- | lisp/files.el | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/lisp/files.el b/lisp/files.el index 7b5bca4a4db..f4cfbd86289 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -481,6 +481,33 @@ Do not specify them in other calls." | |||
| 481 | (let ((tem (copy-sequence file-name-handler-alist))) | 481 | (let ((tem (copy-sequence file-name-handler-alist))) |
| 482 | (delq (rassq 'ange-ftp-completion-hook-function tem) tem))))) | 482 | (delq (rassq 'ange-ftp-completion-hook-function tem) tem))))) |
| 483 | (or prev-dirs (setq prev-dirs (list nil))) | 483 | (or prev-dirs (setq prev-dirs (list nil))) |
| 484 | |||
| 485 | ;; andrewi@harlequin.co.uk - none of the following code (except for | ||
| 486 | ;; invoking the file-name handler) currently applies on Windows | ||
| 487 | ;; (ie. there are no native symlinks), but there is an issue with | ||
| 488 | ;; case differences being ignored by the OS, and short "8.3 DOS" | ||
| 489 | ;; name aliases existing for all files. (The short names are not | ||
| 490 | ;; reported by directory-files, but can be used to refer to files.) | ||
| 491 | ;; It seems appropriate for file-truename to resolve these issues in | ||
| 492 | ;; the most natural way, which on Windows is to call the function | ||
| 493 | ;; `w32-long-file-name' - this returns the exact name of a file as | ||
| 494 | ;; it is stored on disk (expanding short name aliases with the full | ||
| 495 | ;; name in the process). | ||
| 496 | (if (eq system-type 'windows-nt) | ||
| 497 | (let ((handler (find-file-name-handler filename 'file-truename)) | ||
| 498 | newname) | ||
| 499 | ;; For file name that has a special handler, call handler. | ||
| 500 | ;; This is so that ange-ftp can save time by doing a no-op. | ||
| 501 | (if handler | ||
| 502 | (setq filename (funcall handler 'file-truename filename)) | ||
| 503 | ;; If filename contains a wildcard, newname will be the old name. | ||
| 504 | (if (string-match "[*?]" filename) | ||
| 505 | (setq newname filename) | ||
| 506 | ;; If filename doesn't exist, newname will be nil. | ||
| 507 | (setq newname (w32-long-file-name filename))) | ||
| 508 | (setq filename (or newname filename))) | ||
| 509 | (setq done t))) | ||
| 510 | |||
| 484 | ;; If this file directly leads to a link, process that iteratively | 511 | ;; If this file directly leads to a link, process that iteratively |
| 485 | ;; so that we don't use lots of stack. | 512 | ;; so that we don't use lots of stack. |
| 486 | (while (not done) | 513 | (while (not done) |
| @@ -1154,8 +1181,8 @@ run `normal-mode' explicitly." | |||
| 1154 | ("\\.awk\\'" . awk-mode) | 1181 | ("\\.awk\\'" . awk-mode) |
| 1155 | ("\\.prolog\\'" . prolog-mode) | 1182 | ("\\.prolog\\'" . prolog-mode) |
| 1156 | ("\\.tar\\'" . tar-mode) | 1183 | ("\\.tar\\'" . tar-mode) |
| 1157 | ("\\.\\(arc\\|zip\\|lzh\\|zoo\\)\\'" . archive-mode) | 1184 | ("\\.\\(arc\\|zip\\|lzh\\|zoo\\|jar\\)\\'" . archive-mode) |
| 1158 | ("\\.\\(ARC\\|ZIP\\|LZH\\|ZOO\\)\\'" . archive-mode) | 1185 | ("\\.\\(ARC\\|ZIP\\|LZH\\|ZOO\\|JAR\\)\\'" . archive-mode) |
| 1159 | ;; Mailer puts message to be edited in | 1186 | ;; Mailer puts message to be edited in |
| 1160 | ;; /tmp/Re.... or Message | 1187 | ;; /tmp/Re.... or Message |
| 1161 | ("\\`/tmp/Re" . text-mode) | 1188 | ("\\`/tmp/Re" . text-mode) |
| @@ -2569,7 +2596,7 @@ non-nil, it is called instead of rereading visited file contents." | |||
| 2569 | (not (file-exists-p file-name))) | 2596 | (not (file-exists-p file-name))) |
| 2570 | (error "Auto-save file %s not current" file-name)) | 2597 | (error "Auto-save file %s not current" file-name)) |
| 2571 | ((save-window-excursion | 2598 | ((save-window-excursion |
| 2572 | (if (not (eq system-type 'vax-vms)) | 2599 | (if (not (memq system-type '(vax-vms windows-nt))) |
| 2573 | (with-output-to-temp-buffer "*Directory*" | 2600 | (with-output-to-temp-buffer "*Directory*" |
| 2574 | (buffer-disable-undo standard-output) | 2601 | (buffer-disable-undo standard-output) |
| 2575 | (call-process "ls" nil standard-output nil | 2602 | (call-process "ls" nil standard-output nil |