X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/830e46e61ba1316e771c72a15e709d3d12e150b7..64c4b6844f15f2b1256e0a94d4bf449a3d4b8a5a:/lisp/term/w32-win.el diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index cbd08e68a3..e103562ba7 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el @@ -1,6 +1,6 @@ ;;; w32-win.el --- parse switches controlling interface with W32 window system -*- lexical-binding: t -*- -;; Copyright (C) 1993-1994, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1993-1994, 2001-2014 Free Software Foundation, Inc. ;; Author: Kevin Gallo ;; Keywords: terminals @@ -110,8 +110,13 @@ (let ((f (if (eq system-type 'cygwin) (cygwin-convert-file-name-from-windows file-name t) (subst-char-in-string ?\\ ?/ file-name))) - (coding (or file-name-coding-system - default-file-name-coding-system))) + (coding (if (eq system-type 'windows-nt) + ;; Native w32 build pretends that its file names + ;; are encoded in UTF-8, and converts to the + ;; appropriate encoding internally. + 'utf-8 + (or file-name-coding-system + default-file-name-coding-system)))) (setq file-name (mapconcat 'url-hexify-string @@ -201,7 +206,8 @@ European languages which are distributed with Windows as See the documentation of `create-fontset-from-fontset-spec' for the format.") (defun x-win-suspend-error () - "Report an error when a suspend is attempted." + "Report an error when a suspend is attempted. +This returns an error if any Emacs frames are X frames, or always under W32." (error "Suspending an Emacs running under W32 makes no sense")) (defvar dynamic-library-alist) @@ -216,20 +222,52 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") ;; the version we were compiled against. (If we were compiled ;; without PNG support, libpng-version's value is -1.) (if (>= libpng-version 10400) - ;; libpng14-14.dll is libpng 1.4.3 from GTK+ - '(png "libpng14-14.dll" "libpng14.dll") + (let ((major (/ libpng-version 10000)) + (minor (mod (/ libpng-version 100) 10))) + (list 'png + ;; libpngXY.dll is the default name when building + ;; with CMake or from a lpngXYY tarball on w32, + ;; libpngXY-XY.dll is the DLL name when building + ;; with libtool / autotools + (format "libpng%d%d.dll" major minor) + (format "libpng%d%d-%d%d.dll" major minor major minor))) '(png "libpng12d.dll" "libpng12.dll" "libpng3.dll" "libpng.dll" ;; these are libpng 1.2.8 from GTK+ "libpng13d.dll" "libpng13.dll")) - '(jpeg "jpeg62.dll" "libjpeg.dll" "jpeg-62.dll" "jpeg.dll") - '(tiff "libtiff3.dll" "libtiff.dll") - '(gif "giflib4.dll" "libungif4.dll" "libungif.dll") + '(tiff "libtiff-5.dll" "libtiff3.dll" "libtiff.dll") + (if (> libjpeg-version 62) + ;; Versions of libjpeg after 6b are incompatible with + ;; earlier versions, and each of versions 7, 8, and 9 is + ;; also incompatible with the preceding ones (the core data + ;; structures used for communications with the library + ;; gained additional members with each new version). So we + ;; must use only the version of the library which Emacs was + ;; compiled against. + (list 'jpeg (format "libjpeg-%d.dll" (/ libjpeg-version 10))) + '(jpeg "jpeg62.dll" "libjpeg.dll" "jpeg-62.dll" "jpeg.dll")) + ;; Versions of giflib 5.0.0 and later changed signatures of + ;; several functions used by Emacs, which makes those versions + ;; incompatible with previous ones. We select the correct + ;; libraries according to the version of giflib we were + ;; compiled against. (If we were compiled without GIF support, + ;; libgif-version's value is -1.) + (if (>= libgif-version 50100) + ;; Yes, giflib 5.0 uses 6 as the major version of the API, + ;; and giflib 5.1 uses 7, thus "libgif-7.dll" and + ;; "libgif-6.dll" below (giflib 4.x used 5 as the major API + ;; version). giflib5.dll is from the lua-files project, + ;; and gif.dll is from luapower. + '(gif "libgif-7.dll") + (if (>= libgif-version 50000) + '(gif "libgif-6.dll" "giflib5.dll" "gif.dll") + '(gif "libgif-5.dll" "giflib4.dll" "libungif4.dll" "libungif.dll"))) '(svg "librsvg-2-2.dll") '(gdk-pixbuf "libgdk_pixbuf-2.0-0.dll") '(glib "libglib-2.0-0.dll") '(gobject "libgobject-2.0-0.dll") '(gnutls "libgnutls-28.dll" "libgnutls-26.dll") - '(libxml2 "libxml2-2.dll" "libxml2.dll"))) + '(libxml2 "libxml2-2.dll" "libxml2.dll") + '(zlib "zlib1.dll" "libz-1.dll"))) ;;; multi-tty support (defvar w32-initialized nil @@ -237,6 +275,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") (declare-function x-open-connection "w32fns.c" (display &optional xrm-string must-succeed)) +(declare-function create-default-fontset "fontset" ()) (declare-function create-fontset-from-fontset-spec "fontset" (fontset-spec &optional style-variant noerror)) (declare-function create-fontset-from-x-resource "fontset" ()) @@ -246,7 +285,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") (declare-function x-parse-geometry "frame.c" (string)) (defvar x-command-line-resources) -(defun w32-initialize-window-system () +(defun w32-initialize-window-system (&optional _display) "Initialize Emacs for W32 GUI frames." (cl-assert (not w32-initialized))