]> code.delx.au - gnu-emacs/blobdiff - lisp/w32-fns.el
Merge from emacs-24; up to 2012-05-04T19:17:01Z!monnier@iro.umontreal.ca
[gnu-emacs] / lisp / w32-fns.el
index 1abb29febc7a043d810e8e233d8ae054af5d5485..1769ee73be576d5f01c9fa01ff975124be4373a5 100644 (file)
@@ -1,7 +1,6 @@
-;;; w32-fns.el --- Lisp routines for Windows NT
+;;; w32-fns.el --- Lisp routines for 32-bit Windows
 
-;; Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-;;   2009, 2010  Free Software Foundation, Inc.
+;; Copyright (C) 1994, 2001-2012 Free Software Foundation, Inc.
 
 ;; Author: Geoff Voelker <voelker@cs.washington.edu>
 ;; Keywords: internal
 
 ;;;; Function keys
 
-(defvar x-alternatives-map
-  (let ((map (make-sparse-keymap)))
-    ;; Map certain keypad keys into ASCII characters that people usually expect.
-    (define-key map [M-backspace] [?\M-\d])
-    (define-key map [M-delete] [?\M-\d])
-    (define-key map [M-tab] [?\M-\t])
-    (define-key map [M-linefeed] [?\M-\n])
-    (define-key map [M-clear] [?\M-\C-l])
-    (define-key map [M-return] [?\M-\C-m])
-    (define-key map [M-escape] [?\M-\e])
-    (define-key map [iso-lefttab] [backtab])
-    (define-key map [S-iso-lefttab] [backtab])
-    (define-key map [S-tab] [backtab])
-    map)
-  "Keymap of possible alternative meanings for some keys.")
-
-(defun x-setup-function-keys (frame)
-  "Set up `function-key-map' on the graphical frame FRAME."
-  ;; Don't do this twice on the same display, or it would break
-  ;; normal-erase-is-backspace-mode.
-  (unless (terminal-parameter frame 'x-setup-function-keys)
-    ;; Map certain keypad keys into ASCII characters that people usually expect.
-    (with-selected-frame frame
-      (let ((map (copy-keymap x-alternatives-map)))
-        (set-keymap-parent map (keymap-parent local-function-key-map))
-        (set-keymap-parent local-function-key-map map)))
-    (set-terminal-parameter frame 'x-setup-function-keys t)))
-
 (declare-function set-message-beep "w32console.c")
 (declare-function w32-get-clipboard-data "w32select.c")
 (declare-function w32-get-locale-info "w32proc.c")
@@ -85,7 +56,7 @@ That includes all Windows systems except for 9X/Me."
 
 (defun w32-shell-name ()
   "Return the name of the shell being used."
-  (or (bound-and-true-p explicit-shell-file-name)
+  (or (bound-and-true-p shell-file-name)
       (getenv "ESHELL")
       (getenv "SHELL")
       (and (w32-using-nt) "cmd.exe")
@@ -190,7 +161,7 @@ You should set this to t when using a non-system shell.\n\n"))))
 (add-hook 'before-init-hook 'set-default-process-coding-system)
 
 
-;;; Basic support functions for managing Emacs' locale setting
+;;; Basic support functions for managing Emacs's locale setting
 
 (defvar w32-valid-locales nil
   "List of locale ids known to be supported.")
@@ -221,24 +192,6 @@ You should set this to t when using a non-system shell.\n\n"))))
                     (w32-get-locale-info locale)
                     (w32-get-locale-info locale t))))))
 
-;; Setup Info-default-directory-list to include the info directory
-;; near where Emacs executable was installed.  We used to set INFOPATH,
-;; but when this is set Info-default-directory-list is ignored.  We
-;; also cannot rely upon what is set in paths.el because they assume
-;; that configuration during build time is correct for runtime.
-(defun w32-init-info ()
-  (let* ((instdir (file-name-directory invocation-directory))
-        (dir1 (expand-file-name "../info/" instdir))
-        (dir2 (expand-file-name "../../../info/" instdir)))
-    (if (file-exists-p dir1)
-       (setq Info-default-directory-list
-             (append Info-default-directory-list (list dir1)))
-      (if (file-exists-p dir2)
-         (setq Info-default-directory-list
-               (append Info-default-directory-list (list dir2)))))))
-
-(add-hook 'before-init-hook 'w32-init-info)
-
 ;; The variable source-directory is used to initialize Info-directory-list.
 ;; However, the common case is that Emacs is being used from a binary
 ;; distribution, and the value of source-directory is meaningless in that
@@ -314,7 +267,7 @@ Note that on MS-Windows, primary and secondary selections set by Emacs
 are not available to other programs."
   (put 'x-selections (or type 'PRIMARY) data))
 
-(defun x-get-selection (&optional type data-type)
+(defun x-get-selection (&optional type _data-type)
   "Return the value of an X Windows selection.
 The argument TYPE (default `PRIMARY') says which selection,
 and the argument DATA-TYPE (default `STRING') says
@@ -364,6 +317,8 @@ This function is provided for backward compatibility, since
 (global-set-key [lwindow] 'ignore)
 (global-set-key [rwindow] 'ignore)
 
+(defvar w32-charset-info-alist)                ; w32font.c
+
 (defun w32-add-charset-info (xlfd-charset windows-charset codepage)
   "Function to add character sets to display with Windows fonts.
 Creates entries in `w32-charset-info-alist'.
@@ -408,10 +363,10 @@ bit output with no translation."
 (w32-add-charset-info "mac-roman" 'w32-charset-mac 10000)
 (w32-add-charset-info "iso10646-1" 'w32-charset-default t)
 
-;;   ;; If unicode windows charset is not defined, use ansi fonts.
+;;   ;; If Unicode Windows charset is not defined, use ansi fonts.
 ;;   (w32-add-charset-info "iso10646-1" 'w32-charset-ansi t))
 
-;; Prefered names
+;; Preferred names
 (w32-add-charset-info "big5-0" 'w32-charset-chinesebig5 950)
 (w32-add-charset-info "gb2312.1980-0" 'w32-charset-gb2312 936)
 (w32-add-charset-info "jisx0208-sjis" 'w32-charset-shiftjis 932)
@@ -432,22 +387,6 @@ bit output with no translation."
 ;; from x-selection-value.
 (defvar x-last-selected-text nil)
 
-(defun x-select-text (text)
-  "Select TEXT, a string, according to the window system.
-
-On X, if `x-select-enable-clipboard' is non-nil, copy TEXT to the
-clipboard.  If `x-select-enable-primary' is non-nil, put TEXT in
-the primary selection.
-
-On Windows, make TEXT the current selection.  If
-`x-select-enable-clipboard' is non-nil, copy the text to the
-clipboard as well.
-
-On Nextstep, put TEXT in the pasteboard."
-  (if x-select-enable-clipboard
-      (w32-set-clipboard-data text))
-  (setq x-last-selected-text text))
-
 (defun x-get-selection-value ()
   "Return the value of the current selection.
 Consult the selection.  Treat empty strings as if they were unset."
@@ -476,6 +415,11 @@ Consult the selection.  Treat empty strings as if they were unset."
 
 \f
 ;;;; Support for build process
+
+;; From autoload.el
+(defvar autoload-make-program)
+(defvar generated-autoload-file)
+
 (defun w32-batch-update-autoloads ()
   "Like `batch-update-autoloads', but takes the name of the autoloads file
 from the command line.
@@ -503,5 +447,4 @@ to include Sed, which is used by leim/Makefile.in to do the job."
   (delete-matching-lines "^$\\|^;")
   (save-buffers-kill-emacs t))
 
-;; arch-tag: c49b48cc-0f4f-454f-a274-c2dc34815e14
 ;;; w32-fns.el ends here