]> code.delx.au - gnu-emacs/blobdiff - lisp/w32-fns.el
(Default Simplifications): Add missing ).
[gnu-emacs] / lisp / w32-fns.el
index 6a8037ceac0727dee6c74e3b594f61d54cec7701..86703a3b9b512f454e22818e46a40ee9767db80c 100644 (file)
@@ -1,6 +1,6 @@
 ;;; w32-fns.el --- Lisp routines for Windows NT
 
-;; Copyright (C) 1994, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 2001, 2004 Free Software Foundation, Inc.
 
 ;; Author: Geoff Voelker <voelker@cs.washington.edu>
 ;; Keywords: internal
@@ -54,7 +54,8 @@ numbers, and the build number."
   (x-server-version))
 
 (defun w32-using-nt ()
-  "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.
+That includes all Windows systems except for 9X/Me."
   (and (eq system-type 'windows-nt) (getenv "SystemRoot")))
 
 (defun w32-shell-name ()
@@ -71,7 +72,7 @@ numbers, and the build number."
               w32-system-shells)))
 
 (defun w32-shell-dos-semantics ()
-  "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."
   (or (w32-system-shell-p (w32-shell-name))
       (and (member (downcase (file-name-nondirectory (w32-shell-name)))
                   '("cmdproxy" "cmdproxy.exe"))
@@ -229,9 +230,13 @@ You should set this to t when using a non-system shell.\n\n"))))
 
 (defun convert-standard-filename (filename)
   "Convert a standard file's name to something suitable for the current OS.
-This function's standard definition is trivial; it just returns the argument.
-However, on some systems, the function is redefined
-with a definition that really does change some file names."
+This means to guarantee valid names and perhaps to canonicalize
+certain patterns.
+
+On Windows and DOS, replace invalid characters.  On DOS, make
+sure to obey the 8.3 limitations.  On Windows, turn Cygwin names
+into native names, and also turn slashes into backslashes if the
+shell requires it (see `w32-shell-dos-semantics')."
   (let ((name
          (save-match-data
            (if (string-match "\\`/cygdrive/\\([a-zA-Z]\\)/" filename)
@@ -265,13 +270,13 @@ with a definition that really does change some file names."
   (get 'x-selections type))
 
 (defun set-w32-system-coding-system (coding-system)
-  "Set the coding system used by the Windows System to CODING-SYSTEM.
+  "Set the coding system used by the Windows system to CODING-SYSTEM.
 This is used for things like passing font names with non-ASCII
 characters in them to the system. For a list of possible values of
 CODING-SYSTEM, use \\[list-coding-systems].
 
 This function is provided for backward compatibility, since
-w32-system-coding-system is now an alias for `locale-coding-system'."
+`w32-system-coding-system' is now an alias for `locale-coding-system'."
   (interactive
    (list (let ((default locale-coding-system))
            (read-coding-system
@@ -359,12 +364,13 @@ bit output with no translation."
                (cons xlfd-charset (cons windows-charset codepage)))
   )
 
-(w32-add-charset-info "iso8859-1" 'w32-charset-ansi 1252)
+;; The last charset we add becomes the "preferred" charset for the return
+;; value from w32-select-font etc, so list the most important charsets last.
 (w32-add-charset-info "iso8859-14" 'w32-charset-ansi  28604)
 (w32-add-charset-info "iso8859-15" 'w32-charset-ansi  28605)
-(w32-add-charset-info "jisx0208-sjis" 'w32-charset-shiftjis 932)
 (w32-add-charset-info "jisx0201-latin" 'w32-charset-shiftjis 932)
 (w32-add-charset-info "jisx0201-katakana" 'w32-charset-shiftjis 932)
+(w32-add-charset-info "jisx0208-sjis" 'w32-charset-shiftjis 932)
 (w32-add-charset-info "ksc5601.1987" 'w32-charset-hangeul 949)
 (w32-add-charset-info "big5" 'w32-charset-chinesebig5 950)
 (w32-add-charset-info "gb2312" 'w32-charset-gb2312 936)
@@ -376,22 +382,23 @@ bit output with no translation."
       (w32-add-charset-info "iso8859-2" 'w32-charset-easteurope 28592)
       (w32-add-charset-info "iso8859-3" 'w32-charset-turkish 28593)
       (w32-add-charset-info "iso8859-4" 'w32-charset-baltic 28594)
-      (w32-add-charset-info "iso8859-5" 'w32-charset-russian 28595)
       (w32-add-charset-info "iso8859-6" 'w32-charset-arabic 28596)
       (w32-add-charset-info "iso8859-7" 'w32-charset-greek 28597)
       (w32-add-charset-info "iso8859-8" 'w32-charset-hebrew 1255)
       (w32-add-charset-info "iso8859-9" 'w32-charset-turkish 1254)
       (w32-add-charset-info "iso8859-13" 'w32-charset-baltic 1257)
       (w32-add-charset-info "koi8-r" 'w32-charset-russian 20866)
+      (w32-add-charset-info "iso8859-5" 'w32-charset-russian 28595)
       (w32-add-charset-info "tis620" 'w32-charset-thai 874)
       (w32-add-charset-info "ksc5601.1992" 'w32-charset-johab 1361)
       (w32-add-charset-info "mac" 'w32-charset-mac nil)))
 (if (boundp 'w32-unicode-charset-defined)
     (progn
-      (w32-add-charset-info "iso10646-1" 'w32-charset-unicode t)
-      (w32-add-charset-info "unicode" 'w32-charset-unicode t))
+      (w32-add-charset-info "unicode" 'w32-charset-unicode t)
+      (w32-add-charset-info "iso10646-1" 'w32-charset-unicode t))
   ;; If unicode windows charset is not defined, use ansi fonts.
   (w32-add-charset-info "iso10646-1" 'w32-charset-ansi t))
+(w32-add-charset-info "iso8859-1" 'w32-charset-ansi 1252)
 
 (make-obsolete-variable 'w32-enable-italics
                         'w32-enable-synthesized-fonts "21.1")
@@ -447,4 +454,5 @@ they were unset."
 (setq interprogram-paste-function 'x-get-selection-value)
 
 
+;;; arch-tag: c49b48cc-0f4f-454f-a274-c2dc34815e14
 ;;; w32-fns.el ends here