;;; w32-fns.el --- Lisp routines for Windows NT
-;; Copyright (C) 1994, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+;; 2009, 2010 Free Software Foundation, Inc.
;; Author: Geoff Voelker <voelker@cs.washington.edu>
;; Keywords: internal
(defvar x-alternatives-map
(let ((map (make-sparse-keymap)))
;; Map certain keypad keys into ASCII characters that people usually expect.
- (define-key map [backspace] [127])
- (define-key map [delete] [127])
- (define-key map [tab] [?\t])
- (define-key map [linefeed] [?\n])
- (define-key map [clear] [?\C-l])
- (define-key map [return] [?\C-m])
- (define-key map [escape] [?\e])
(define-key map [M-backspace] [?\M-\d])
(define-key map [M-delete] [?\M-\d])
(define-key map [M-tab] [?\M-\t])
(add-hook 'after-init-hook 'w32-check-shell-configuration)
-;;; Override setting chosen at startup.
+;; Override setting chosen at startup.
(defun set-default-process-coding-system ()
;; Most programs on Windows will accept Unix line endings on input
;; (and some programs ported from Unix require it) but most will
;; produce DOS line endings on output.
(setq default-process-coding-system
- (if default-enable-multibyte-characters
+ (if (default-value 'enable-multibyte-characters)
'(undecided-dos . undecided-unix)
'(raw-text-dos . raw-text-unix)))
;; Make cmdproxy default to using DOS line endings for input,
;; because some Windows programs (including command.com) require it.
(add-to-list 'process-coding-system-alist
`("[cC][mM][dD][pP][rR][oO][xX][yY]"
- . ,(if default-enable-multibyte-characters
+ . ,(if (default-value 'enable-multibyte-characters)
'(undecided-dos . undecided-dos)
'(raw-text-dos . raw-text-dos))))
;; plink needs DOS input when entering the password.
(add-to-list 'process-coding-system-alist
`("[pP][lL][iI][nN][kK]"
- . ,(if default-enable-multibyte-characters
+ . ,(if (default-value 'enable-multibyte-characters)
'(undecided-dos . undecided-dos)
'(raw-text-dos . raw-text-dos)))))
(defvar w32-valid-locales nil
"List of locale ids known to be supported.")
-;;; This is the brute-force version; an efficient version is now
-;;; built-in though.
+;; This is the brute-force version; an efficient version is now
+;; built-in though.
(if (not (fboundp 'w32-get-valid-locale-ids))
(defun w32-get-valid-locale-ids ()
"Return list of all valid Windows locale ids."
(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.
+;; 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))
(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
-;;; case. Even worse, source-directory can refer to a directory on a drive
-;;; on the build machine that happens to be a removable drive on the user's
-;;; machine. When this happens, Emacs tries to access the removable drive
-;;; and produces the abort/retry/ignore dialog. Since we do not use
-;;; source-directory, set it to something that is a reasonable approximation
-;;; on the user's machine.
-
-;(add-hook 'before-init-hook
-; '(lambda ()
-; (setq source-directory (file-name-as-directory
-; (expand-file-name ".." exec-directory)))))
+;; 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
+;; case. Even worse, source-directory can refer to a directory on a drive
+;; on the build machine that happens to be a removable drive on the user's
+;; machine. When this happens, Emacs tries to access the removable drive
+;; and produces the abort/retry/ignore dialog. Since we do not use
+;; source-directory, set it to something that is a reasonable approximation
+;; on the user's machine.
+
+;;(add-hook 'before-init-hook
+;; (lambda ()
+;; (setq source-directory (file-name-as-directory
+;; (expand-file-name ".." exec-directory)))))
(defun convert-standard-filename (filename)
"Convert a standard file's name to something suitable for the current OS.
;; w32-system-coding-system. Use that instead.
(defvaralias 'w32-system-coding-system 'locale-coding-system)
-;;; Set to a system sound if you want a fancy bell.
+;; Set to a system sound if you want a fancy bell.
(set-message-beep nil)
-;;; The "Windows" keys on newer keyboards bring up the Start menu
-;;; whether you want it or not - make Emacs ignore these keystrokes
-;;; rather than beep.
+;; The "Windows" keys on newer keyboards bring up the Start menu
+;; whether you want it or not - make Emacs ignore these keystrokes
+;; rather than beep.
(global-set-key [lwindow] 'ignore)
(global-set-key [rwindow] 'ignore)
-;; These tell read-char how to convert
-;; these special chars to ASCII.
-(put 'tab 'ascii-character ?\t)
-(put 'linefeed 'ascii-character ?\n)
-(put 'clear 'ascii-character 12)
-(put 'return 'ascii-character 13)
-(put 'escape 'ascii-character ?\e)
-(put 'backspace 'ascii-character 127)
-(put 'delete 'ascii-character 127)
-
(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'.
\f
;;;; Selections and cut buffers
-;;; We keep track of the last text selected here, so we can check the
-;;; current selection against it, and avoid passing back our own text
-;;; from x-cut-buffer-or-selection-value.
+;; We keep track of the last text selected here, so we can check the
+;; current selection against it, and avoid passing back our own text
+;; from x-cut-buffer-or-selection-value.
(defvar x-last-selected-text nil)
-;;; It is said that overlarge strings are slow to put into the cut buffer.
-;;; Note this value is overridden below.
+;; It is said that overlarge strings are slow to put into the cut buffer.
+;; Note this value is overridden below.
(defvar x-cut-buffer-max 20000
"Max number of characters to put in the cut buffer.")
\f
(defalias 'x-cut-buffer-or-selection-value 'x-get-selection-value)
-;;; Arrange for the kill and yank functions to set and check the clipboard.
+;; Arrange for the kill and yank functions to set and check the clipboard.
(setq interprogram-cut-function 'x-select-text)
(setq interprogram-paste-function 'x-get-selection-value)
munge command-line arguments that include file names to a horrible mess
that Emacs is unable to cope with."
(let ((generated-autoload-file
- (expand-file-name (pop command-line-args-left))))
+ (expand-file-name (pop command-line-args-left)))
+ ;; I can only assume the same considerations may apply here...
+ (autoload-make-program (pop command-line-args-left)))
(batch-update-autoloads)))
(defun w32-append-code-lines (orig extra)