1 |
;;; w32-fns.el --- Lisp routines for Windows NT |
;;; w32-fns.el --- Lisp routines for Windows NT |
2 |
|
|
3 |
;; Copyright (C) 1994, 2001 Free Software Foundation, Inc. |
;; Copyright (C) 1994, 2001, 2004 Free Software Foundation, Inc. |
4 |
|
|
5 |
;; Author: Geoff Voelker <voelker@cs.washington.edu> |
;; Author: Geoff Voelker <voelker@cs.washington.edu> |
6 |
;; Keywords: internal |
;; Keywords: internal |
54 |
(x-server-version)) |
(x-server-version)) |
55 |
|
|
56 |
(defun w32-using-nt () |
(defun w32-using-nt () |
57 |
"Return non-nil if literally running on Windows NT (i.e., not Windows 9X)." |
"Return non-nil if running on a 32-bit Windows system. |
58 |
|
That includes all Windows systems except for 9X/Me." |
59 |
(and (eq system-type 'windows-nt) (getenv "SystemRoot"))) |
(and (eq system-type 'windows-nt) (getenv "SystemRoot"))) |
60 |
|
|
61 |
(defun w32-shell-name () |
(defun w32-shell-name () |
72 |
w32-system-shells))) |
w32-system-shells))) |
73 |
|
|
74 |
(defun w32-shell-dos-semantics () |
(defun w32-shell-dos-semantics () |
75 |
"Return t if the interactive shell being used expects msdos shell semantics." |
"Return non-nil if the interactive shell being used expects MSDOS shell semantics." |
76 |
(or (w32-system-shell-p (w32-shell-name)) |
(or (w32-system-shell-p (w32-shell-name)) |
77 |
(and (member (downcase (file-name-nondirectory (w32-shell-name))) |
(and (member (downcase (file-name-nondirectory (w32-shell-name))) |
78 |
'("cmdproxy" "cmdproxy.exe")) |
'("cmdproxy" "cmdproxy.exe")) |
230 |
|
|
231 |
(defun convert-standard-filename (filename) |
(defun convert-standard-filename (filename) |
232 |
"Convert a standard file's name to something suitable for the current OS. |
"Convert a standard file's name to something suitable for the current OS. |
233 |
This function's standard definition is trivial; it just returns the argument. |
This means to guarantee valid names and perhaps to canonicalize |
234 |
However, on some systems, the function is redefined |
certain patterns. |
235 |
with a definition that really does change some file names." |
|
236 |
|
On Windows and DOS, replace invalid characters. On DOS, make |
237 |
|
sure to obey the 8.3 limitations. On Windows, turn Cygwin names |
238 |
|
into native names, and also turn slashes into backslashes if the |
239 |
|
shell requires it (see `w32-shell-dos-semantics')." |
240 |
(let ((name |
(let ((name |
241 |
(save-match-data |
(save-match-data |
242 |
(if (string-match "\\`/cygdrive/\\([a-zA-Z]\\)/" filename) |
(if (string-match "\\`/cygdrive/\\([a-zA-Z]\\)/" filename) |
270 |
(get 'x-selections type)) |
(get 'x-selections type)) |
271 |
|
|
272 |
(defun set-w32-system-coding-system (coding-system) |
(defun set-w32-system-coding-system (coding-system) |
273 |
"Set the coding system used by the Windows System to CODING-SYSTEM. |
"Set the coding system used by the Windows system to CODING-SYSTEM. |
274 |
This is used for things like passing font names with non-ASCII |
This is used for things like passing font names with non-ASCII |
275 |
characters in them to the system. For a list of possible values of |
characters in them to the system. For a list of possible values of |
276 |
CODING-SYSTEM, use \\[list-coding-systems]. |
CODING-SYSTEM, use \\[list-coding-systems]. |
277 |
|
|
278 |
This function is provided for backward compatibility, since |
This function is provided for backward compatibility, since |
279 |
w32-system-coding-system is now an alias for `locale-coding-system'." |
`w32-system-coding-system' is now an alias for `locale-coding-system'." |
280 |
(interactive |
(interactive |
281 |
(list (let ((default locale-coding-system)) |
(list (let ((default locale-coding-system)) |
282 |
(read-coding-system |
(read-coding-system |