Mercurial > emacs
annotate lisp/w32-fns.el @ 25039:7a53fe8294bf
(perform-replace): Turn off case-fold-search
if FROM-STRING argument has uppercase in it.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Wed, 21 Jul 1999 23:01:38 +0000 |
parents | a969304198eb |
children | 719f644e7cec |
rev | line source |
---|---|
16592
a5e9fa379097
Use new file name w32-fns.el
Geoff Voelker <voelker@cs.washington.edu>
parents:
16028
diff
changeset
|
1 ;;; w32-fns.el --- Lisp routines for Windows NT. |
14169 | 2 |
9803 | 3 ;; Copyright (C) 1994 Free Software Foundation, Inc. |
4 | |
21059 | 5 ;; Author: Geoff Voelker <voelker@cs.washington.edu> |
9803 | 6 |
7 ;; This file is part of GNU Emacs. | |
8 | |
9 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
10 ;; it under the terms of the GNU General Public License as published by | |
11 ;; the Free Software Foundation; either version 2, or (at your option) | |
12 ;; any later version. | |
13 | |
14 ;; GNU Emacs is distributed in the hope that it will be useful, | |
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 ;; GNU General Public License for more details. | |
18 | |
19 ;; You should have received a copy of the GNU General Public License | |
14169 | 20 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
22 ;; Boston, MA 02111-1307, USA. | |
9803 | 23 |
24 ;;; Commentary: | |
25 | |
26 ;; (August 12, 1993) | |
11399 | 27 ;; Created. |
9803 | 28 |
11399 | 29 ;; (November 21, 1994) |
30 ;; [C-M-backspace] defined. | |
31 ;; mode-line-format defined to show buffer file type. | |
32 ;; audio bell initialized. | |
9803 | 33 |
34 ;;; Code: | |
35 | |
36 ;; Map delete and backspace | |
37 (define-key function-key-map [backspace] "\177") | |
38 (define-key function-key-map [delete] "\C-d") | |
39 (define-key function-key-map [M-backspace] [?\M-\177]) | |
11399 | 40 (define-key function-key-map [C-M-backspace] [\C-\M-delete]) |
41 | |
9803 | 42 ;; Ignore case on file-name completion |
43 (setq completion-ignore-case t) | |
44 | |
19692
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
45 ;; Map all versions of a filename (8.3, longname, mixed case) to the |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
46 ;; same buffer. |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
47 (setq find-file-visit-truename t) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
48 |
21597
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
49 (defvar w32-system-shells '("cmd" "cmd.exe" "command" "command.com" |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
50 "4nt" "4nt.exe" "4dos" "4dos.exe" |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
51 "ndos" "ndos.exe") |
19692
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
52 "List of strings recognized as Windows NT/9X system shells.") |
17549
f57de209f01b
(w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents:
16859
diff
changeset
|
53 |
f57de209f01b
(w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents:
16859
diff
changeset
|
54 (defun w32-using-nt () |
19692
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
55 "Return t if literally running on Windows NT (i.e., not Windows 9X)." |
17549
f57de209f01b
(w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents:
16859
diff
changeset
|
56 (and (eq system-type 'windows-nt) (getenv "SystemRoot"))) |
f57de209f01b
(w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents:
16859
diff
changeset
|
57 |
f57de209f01b
(w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents:
16859
diff
changeset
|
58 (defun w32-shell-name () |
19692
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
59 "Return the name of the shell being used." |
17549
f57de209f01b
(w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents:
16859
diff
changeset
|
60 (or (and (boundp 'explicit-shell-file-name) explicit-shell-file-name) |
f57de209f01b
(w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents:
16859
diff
changeset
|
61 (getenv "ESHELL") |
f57de209f01b
(w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents:
16859
diff
changeset
|
62 (getenv "SHELL") |
f57de209f01b
(w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents:
16859
diff
changeset
|
63 (and (w32-using-nt) "cmd.exe") |
f57de209f01b
(w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents:
16859
diff
changeset
|
64 "command.com")) |
f57de209f01b
(w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents:
16859
diff
changeset
|
65 |
19692
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
66 (defun w32-system-shell-p (shell-name) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
67 (and shell-name |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
68 (member (downcase (file-name-nondirectory shell-name)) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
69 w32-system-shells))) |
9803 | 70 |
23173
073e555c28c8
(w32-shell-dos-semantics): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21597
diff
changeset
|
71 (defun w32-shell-dos-semantics () |
073e555c28c8
(w32-shell-dos-semantics): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21597
diff
changeset
|
72 "Return t if the interactive shell being used expects msdos shell semantics." |
073e555c28c8
(w32-shell-dos-semantics): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21597
diff
changeset
|
73 (or (w32-system-shell-p (w32-shell-name)) |
073e555c28c8
(w32-shell-dos-semantics): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21597
diff
changeset
|
74 (and (member (downcase (file-name-nondirectory (w32-shell-name))) |
073e555c28c8
(w32-shell-dos-semantics): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21597
diff
changeset
|
75 '("cmdproxy" "cmdproxy.exe")) |
073e555c28c8
(w32-shell-dos-semantics): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21597
diff
changeset
|
76 (w32-system-shell-p (getenv "COMSPEC"))))) |
073e555c28c8
(w32-shell-dos-semantics): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21597
diff
changeset
|
77 |
21597
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
78 (defvar w32-allow-system-shell nil |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
79 "*Disable startup warning when using \"system\" shells.") |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
80 |
19692
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
81 (defun w32-check-shell-configuration () |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
82 "Check the configuration of shell variables on Windows NT/9X. |
17549
f57de209f01b
(w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents:
16859
diff
changeset
|
83 This function is invoked after loading the init files and processing |
19692
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
84 the command line arguments. It issues a warning if the user or site |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
85 has configured the shell with inappropriate settings." |
21597
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
86 (interactive) |
19692
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
87 (let ((prev-buffer (current-buffer)) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
88 (buffer (get-buffer-create "*Shell Configuration*")) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
89 (system-shell)) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
90 (set-buffer buffer) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
91 (erase-buffer) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
92 (if (w32-system-shell-p (getenv "ESHELL")) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
93 (insert (format "Warning! The ESHELL environment variable uses %s. |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
94 You probably want to change it so that it uses cmdproxy.exe instead.\n\n" |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
95 (getenv "ESHELL")))) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
96 (if (w32-system-shell-p (getenv "SHELL")) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
97 (insert (format "Warning! The SHELL environment variable uses %s. |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
98 You probably want to change it so that it uses cmdproxy.exe instead.\n\n" |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
99 (getenv "SHELL")))) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
100 (if (w32-system-shell-p shell-file-name) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
101 (insert (format "Warning! shell-file-name uses %s. |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
102 You probably want to change it so that it uses cmdproxy.exe instead.\n\n" |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
103 shell-file-name))) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
104 (if (and (boundp 'explicit-shell-file-name) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
105 (w32-system-shell-p explicit-shell-file-name)) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
106 (insert (format "Warning! explicit-shell-file-name uses %s. |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
107 You probably want to change it so that it uses cmdproxy.exe instead.\n\n" |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
108 explicit-shell-file-name))) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
109 (setq system-shell (> (buffer-size) 0)) |
21597
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
110 |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
111 ;; Allow user to specify that they really do want to use one of the |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
112 ;; "system" shells, despite the drawbacks, but still warn if |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
113 ;; shell-command-switch doesn't match. |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
114 (if w32-allow-system-shell |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
115 (erase-buffer)) |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
116 |
19692
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
117 (cond (system-shell |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
118 ;; System shells. |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
119 (if (string-equal "-c" shell-command-switch) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
120 (insert "Warning! shell-command-switch is \"-c\". |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
121 You should set this to \"/c\" when using a system shell.\n\n")) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
122 (if w32-quote-process-args |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
123 (insert "Warning! w32-quote-process-args is t. |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
124 You should set this to nil when using a system shell.\n\n"))) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
125 ;; Non-system shells. |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
126 (t |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
127 (if (string-equal "/c" shell-command-switch) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
128 (insert "Warning! shell-command-switch is \"/c\". |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
129 You should set this to \"-c\" when using a non-system shell.\n\n")) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
130 (if (not w32-quote-process-args) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
131 (insert "Warning! w32-quote-process-args is nil. |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
132 You should set this to t when using a non-system shell.\n\n")))) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
133 (if (> (buffer-size) 0) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
134 (display-buffer buffer) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
135 (kill-buffer buffer)) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
136 (set-buffer prev-buffer))) |
17549
f57de209f01b
(w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents:
16859
diff
changeset
|
137 |
19692
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
138 (add-hook 'after-init-hook 'w32-check-shell-configuration) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
139 |
24514
06762ce530be
(set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents:
24498
diff
changeset
|
140 ;;; Override setting chosen at startup. |
06762ce530be
(set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents:
24498
diff
changeset
|
141 (defun set-default-process-coding-system () |
06762ce530be
(set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents:
24498
diff
changeset
|
142 ;; Most programs on Windows will accept Unix line endings on input |
06762ce530be
(set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents:
24498
diff
changeset
|
143 ;; (and some programs ported from Unix require it) but most will |
06762ce530be
(set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents:
24498
diff
changeset
|
144 ;; produce DOS line endings on output. |
06762ce530be
(set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents:
24498
diff
changeset
|
145 (setq default-process-coding-system |
06762ce530be
(set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents:
24498
diff
changeset
|
146 (if default-enable-multibyte-characters |
06762ce530be
(set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents:
24498
diff
changeset
|
147 '(undecided-dos . undecided-unix) |
06762ce530be
(set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents:
24498
diff
changeset
|
148 '(raw-text-dos . raw-text-unix))) |
06762ce530be
(set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents:
24498
diff
changeset
|
149 (or (w32-using-nt) |
06762ce530be
(set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents:
24498
diff
changeset
|
150 ;; On Windows 9x, make cmdproxy default to using DOS line endings |
06762ce530be
(set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents:
24498
diff
changeset
|
151 ;; for input, because command.com requires this. |
06762ce530be
(set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents:
24498
diff
changeset
|
152 (setq process-coding-system-alist |
06762ce530be
(set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents:
24498
diff
changeset
|
153 `(("[cC][mM][dD][pP][rR][oO][xX][yY]" |
06762ce530be
(set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents:
24498
diff
changeset
|
154 . ,(if default-enable-multibyte-characters |
06762ce530be
(set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents:
24498
diff
changeset
|
155 '(undecided-dos . undecided-dos) |
06762ce530be
(set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents:
24498
diff
changeset
|
156 '(raw-text-dos . raw-text-dos))))))) |
06762ce530be
(set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents:
24498
diff
changeset
|
157 |
06762ce530be
(set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents:
24498
diff
changeset
|
158 (add-hook 'before-init-hook 'set-default-process-coding-system) |
06762ce530be
(set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents:
24498
diff
changeset
|
159 |
21597
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
160 |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
161 ;;; Basic support functions for managing Emacs' locale setting |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
162 |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
163 (defvar w32-valid-locales nil |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
164 "List of locale ids known to be supported.") |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
165 |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
166 ;;; This is the brute-force version; an efficient version is now |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
167 ;;; built-in though. |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
168 (if (not (fboundp 'w32-get-valid-locale-ids)) |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
169 (defun w32-get-valid-locale-ids () |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
170 "Return list of all valid Windows locale ids." |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
171 (let ((i 65535) |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
172 locales) |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
173 (while (> i 0) |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
174 (if (w32-get-locale-info i) |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
175 (setq locales (cons i locales))) |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
176 (setq i (1- i))) |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
177 locales))) |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
178 |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
179 (defun w32-list-locales () |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
180 "List the name and id of all locales supported by Windows." |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
181 (interactive) |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
182 (if (null w32-valid-locales) |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
183 (setq w32-valid-locales (w32-get-valid-locale-ids))) |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
184 (switch-to-buffer-other-window (get-buffer-create "*Supported Locales*")) |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
185 (erase-buffer) |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
186 (insert "LCID\tAbbrev\tFull name\n\n") |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
187 (insert (mapconcat |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
188 '(lambda (x) |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
189 (format "%d\t%s\t%s" |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
190 x |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
191 (w32-get-locale-info x) |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
192 (w32-get-locale-info x t))) |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
193 w32-valid-locales "\n")) |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
194 (insert "\n") |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
195 (goto-char (point-min))) |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
196 |
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
197 |
19692
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
198 ;;; Setup Info-default-directory-list to include the info directory |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
199 ;;; near where Emacs executable was installed. We used to set INFOPATH, |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
200 ;;; but when this is set Info-default-directory-list is ignored. We |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
201 ;;; also cannot rely upon what is set in paths.el because they assume |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
202 ;;; that configuration during build time is correct for runtime. |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
203 (defun w32-init-info () |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
204 (let* ((instdir (file-name-directory invocation-directory)) |
21597
409211e285bc
(w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21059
diff
changeset
|
205 (dir1 (expand-file-name "../info/" instdir)) |
19692
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
206 (dir2 (expand-file-name "../../../info/" instdir))) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
207 (if (file-exists-p dir1) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
208 (setq Info-default-directory-list |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
209 (append Info-default-directory-list (list dir1))) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
210 (if (file-exists-p dir2) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
211 (setq Info-default-directory-list |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
212 (append Info-default-directory-list (list dir2))))))) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
213 |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
214 (add-hook 'before-init-hook 'w32-init-info) |
15338
b0d95c32f026
(shell-mode-hook): Set comint-completion-addsuffix
Richard M. Stallman <rms@gnu.org>
parents:
15257
diff
changeset
|
215 |
23571
ae5eea3cc314
Remove a dangling reference to a directory on the
Geoff Voelker <voelker@cs.washington.edu>
parents:
23173
diff
changeset
|
216 ;;; The variable source-directory is used to initialize Info-directory-list. |
ae5eea3cc314
Remove a dangling reference to a directory on the
Geoff Voelker <voelker@cs.washington.edu>
parents:
23173
diff
changeset
|
217 ;;; However, the common case is that Emacs is being used from a binary |
ae5eea3cc314
Remove a dangling reference to a directory on the
Geoff Voelker <voelker@cs.washington.edu>
parents:
23173
diff
changeset
|
218 ;;; distribution, and the value of source-directory is meaningless in that |
ae5eea3cc314
Remove a dangling reference to a directory on the
Geoff Voelker <voelker@cs.washington.edu>
parents:
23173
diff
changeset
|
219 ;;; case. Even worse, source-directory can refer to a directory on a drive |
ae5eea3cc314
Remove a dangling reference to a directory on the
Geoff Voelker <voelker@cs.washington.edu>
parents:
23173
diff
changeset
|
220 ;;; on the build machine that happens to be a removable drive on the user's |
ae5eea3cc314
Remove a dangling reference to a directory on the
Geoff Voelker <voelker@cs.washington.edu>
parents:
23173
diff
changeset
|
221 ;;; machine. When this happens, Emacs tries to access the removable drive |
ae5eea3cc314
Remove a dangling reference to a directory on the
Geoff Voelker <voelker@cs.washington.edu>
parents:
23173
diff
changeset
|
222 ;;; and produces the abort/retry/ignore dialog. Since we do not use |
ae5eea3cc314
Remove a dangling reference to a directory on the
Geoff Voelker <voelker@cs.washington.edu>
parents:
23173
diff
changeset
|
223 ;;; source-directory, set it to something that is a reasonable approximation |
ae5eea3cc314
Remove a dangling reference to a directory on the
Geoff Voelker <voelker@cs.washington.edu>
parents:
23173
diff
changeset
|
224 ;;; on the user's machine. |
ae5eea3cc314
Remove a dangling reference to a directory on the
Geoff Voelker <voelker@cs.washington.edu>
parents:
23173
diff
changeset
|
225 |
ae5eea3cc314
Remove a dangling reference to a directory on the
Geoff Voelker <voelker@cs.washington.edu>
parents:
23173
diff
changeset
|
226 (add-hook 'before-init-hook |
ae5eea3cc314
Remove a dangling reference to a directory on the
Geoff Voelker <voelker@cs.washington.edu>
parents:
23173
diff
changeset
|
227 '(lambda () |
ae5eea3cc314
Remove a dangling reference to a directory on the
Geoff Voelker <voelker@cs.washington.edu>
parents:
23173
diff
changeset
|
228 (setq source-directory (file-name-as-directory |
ae5eea3cc314
Remove a dangling reference to a directory on the
Geoff Voelker <voelker@cs.washington.edu>
parents:
23173
diff
changeset
|
229 (expand-file-name ".." exec-directory))))) |
ae5eea3cc314
Remove a dangling reference to a directory on the
Geoff Voelker <voelker@cs.washington.edu>
parents:
23173
diff
changeset
|
230 |
16859
2a3cc82fa1ea
(make-auto-save-file-name): Replace occurrences of
Geoff Voelker <voelker@cs.washington.edu>
parents:
16592
diff
changeset
|
231 ;; Avoid creating auto-save file names containing invalid characters. |
15135
72a1f82a6748
(original-make-auto-save-file-name): New symbol bound
Geoff Voelker <voelker@cs.washington.edu>
parents:
15003
diff
changeset
|
232 (fset 'original-make-auto-save-file-name |
72a1f82a6748
(original-make-auto-save-file-name): New symbol bound
Geoff Voelker <voelker@cs.washington.edu>
parents:
15003
diff
changeset
|
233 (symbol-function 'make-auto-save-file-name)) |
72a1f82a6748
(original-make-auto-save-file-name): New symbol bound
Geoff Voelker <voelker@cs.washington.edu>
parents:
15003
diff
changeset
|
234 |
72a1f82a6748
(original-make-auto-save-file-name): New symbol bound
Geoff Voelker <voelker@cs.washington.edu>
parents:
15003
diff
changeset
|
235 (defun make-auto-save-file-name () |
72a1f82a6748
(original-make-auto-save-file-name): New symbol bound
Geoff Voelker <voelker@cs.washington.edu>
parents:
15003
diff
changeset
|
236 "Return file name to use for auto-saves of current buffer. |
72a1f82a6748
(original-make-auto-save-file-name): New symbol bound
Geoff Voelker <voelker@cs.washington.edu>
parents:
15003
diff
changeset
|
237 Does not consider `auto-save-visited-file-name' as that variable is checked |
72a1f82a6748
(original-make-auto-save-file-name): New symbol bound
Geoff Voelker <voelker@cs.washington.edu>
parents:
15003
diff
changeset
|
238 before calling this function. You can redefine this for customization. |
72a1f82a6748
(original-make-auto-save-file-name): New symbol bound
Geoff Voelker <voelker@cs.washington.edu>
parents:
15003
diff
changeset
|
239 See also `auto-save-file-name-p'." |
19692
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
240 (convert-standard-filename (original-make-auto-save-file-name))) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
241 |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
242 (defun convert-standard-filename (filename) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
243 "Convert a standard file's name to something suitable for the current OS. |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
244 This function's standard definition is trivial; it just returns the argument. |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
245 However, on some systems, the function is redefined |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
246 with a definition that really does change some file names." |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
247 (let ((name (copy-sequence filename)) |
15135
72a1f82a6748
(original-make-auto-save-file-name): New symbol bound
Geoff Voelker <voelker@cs.washington.edu>
parents:
15003
diff
changeset
|
248 (start 0)) |
19692
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
249 ;; leave ':' if part of drive specifier |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
250 (if (eq (aref name 1) ?:) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
251 (setq start 2)) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
252 ;; destructively replace invalid filename characters with ! |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
253 (while (string-match "[?*:<>|\"\000-\037]" name start) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
254 (aset name (match-beginning 0) ?!) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
255 (setq start (match-end 0))) |
24441
6643d1ccd5a1
(convert-standard-filename): Convert directory
Andrew Innes <andrewi@gnu.org>
parents:
23571
diff
changeset
|
256 ;; convert directory separators to Windows format |
24661
a969304198eb
(convert-standard-filename): Only convert directory
Andrew Innes <andrewi@gnu.org>
parents:
24514
diff
changeset
|
257 ;; (but only if the shell in use requires it) |
a969304198eb
(convert-standard-filename): Only convert directory
Andrew Innes <andrewi@gnu.org>
parents:
24514
diff
changeset
|
258 (if (w32-shell-dos-semantics) |
a969304198eb
(convert-standard-filename): Only convert directory
Andrew Innes <andrewi@gnu.org>
parents:
24514
diff
changeset
|
259 (while (string-match "/" name start) |
a969304198eb
(convert-standard-filename): Only convert directory
Andrew Innes <andrewi@gnu.org>
parents:
24514
diff
changeset
|
260 (aset name (match-beginning 0) ?\\) |
a969304198eb
(convert-standard-filename): Only convert directory
Andrew Innes <andrewi@gnu.org>
parents:
24514
diff
changeset
|
261 (setq start (match-end 0)))) |
a969304198eb
(convert-standard-filename): Only convert directory
Andrew Innes <andrewi@gnu.org>
parents:
24514
diff
changeset
|
262 name)) |
15135
72a1f82a6748
(original-make-auto-save-file-name): New symbol bound
Geoff Voelker <voelker@cs.washington.edu>
parents:
15003
diff
changeset
|
263 |
9803 | 264 ;;; Fix interface to (X-specific) mouse.el |
15350
a8bd6f986389
(x-set-selection, x-get-selection): Define them to really use TYPE.
Richard M. Stallman <rms@gnu.org>
parents:
15338
diff
changeset
|
265 (defun x-set-selection (type data) |
a8bd6f986389
(x-set-selection, x-get-selection): Define them to really use TYPE.
Richard M. Stallman <rms@gnu.org>
parents:
15338
diff
changeset
|
266 (or type (setq type 'PRIMARY)) |
a8bd6f986389
(x-set-selection, x-get-selection): Define them to really use TYPE.
Richard M. Stallman <rms@gnu.org>
parents:
15338
diff
changeset
|
267 (put 'x-selections type data)) |
a8bd6f986389
(x-set-selection, x-get-selection): Define them to really use TYPE.
Richard M. Stallman <rms@gnu.org>
parents:
15338
diff
changeset
|
268 |
a8bd6f986389
(x-set-selection, x-get-selection): Define them to really use TYPE.
Richard M. Stallman <rms@gnu.org>
parents:
15338
diff
changeset
|
269 (defun x-get-selection (&optional type data-type) |
a8bd6f986389
(x-set-selection, x-get-selection): Define them to really use TYPE.
Richard M. Stallman <rms@gnu.org>
parents:
15338
diff
changeset
|
270 (or type (setq type 'PRIMARY)) |
a8bd6f986389
(x-set-selection, x-get-selection): Define them to really use TYPE.
Richard M. Stallman <rms@gnu.org>
parents:
15338
diff
changeset
|
271 (get 'x-selections type)) |
a8bd6f986389
(x-set-selection, x-get-selection): Define them to really use TYPE.
Richard M. Stallman <rms@gnu.org>
parents:
15338
diff
changeset
|
272 |
24498
756058742361
(set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
24441
diff
changeset
|
273 (defun set-w32-system-coding-system (coding-system) |
756058742361
(set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
24441
diff
changeset
|
274 "Set the coding system used by the Windows System to CODING-SYSTEM. |
756058742361
(set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
24441
diff
changeset
|
275 This is used for things like passing font names with non-ASCII |
756058742361
(set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
24441
diff
changeset
|
276 characters in them to the system. For a list of possible values of |
756058742361
(set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
24441
diff
changeset
|
277 CODING-SYSTEM, use \\[list-coding-systems]." |
756058742361
(set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
24441
diff
changeset
|
278 (interactive |
756058742361
(set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
24441
diff
changeset
|
279 (list (let ((default w32-system-coding-system)) |
756058742361
(set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
24441
diff
changeset
|
280 (read-coding-system |
756058742361
(set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
24441
diff
changeset
|
281 (format "Coding system for system calls (default, %s): " |
756058742361
(set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
24441
diff
changeset
|
282 default) |
756058742361
(set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
24441
diff
changeset
|
283 default)))) |
756058742361
(set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
24441
diff
changeset
|
284 (check-coding-system coding-system) |
756058742361
(set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
24441
diff
changeset
|
285 (setq w32-system-coding-system coding-system)) |
756058742361
(set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
24441
diff
changeset
|
286 ;; Set system coding system initially to iso-latin-1 |
756058742361
(set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
24441
diff
changeset
|
287 (set-w32-system-coding-system 'iso-latin-1) |
756058742361
(set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
24441
diff
changeset
|
288 |
11399 | 289 ;;; Set to a system sound if you want a fancy bell. |
290 (set-message-beep nil) | |
291 | |
19692
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
292 ;;; The "Windows" keys on newer keyboards bring up the Start menu |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
293 ;;; whether you want it or not - make Emacs ignore these keystrokes |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
294 ;;; rather than beep. |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
295 (global-set-key [lwindow] 'ignore) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
296 (global-set-key [rwindow] 'ignore) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
297 |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
298 ;; Map certain keypad keys into ASCII characters |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
299 ;; that people usually expect. |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
300 (define-key function-key-map [tab] [?\t]) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
301 (define-key function-key-map [linefeed] [?\n]) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
302 (define-key function-key-map [clear] [11]) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
303 (define-key function-key-map [return] [13]) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
304 (define-key function-key-map [escape] [?\e]) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
305 (define-key function-key-map [M-tab] [?\M-\t]) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
306 (define-key function-key-map [M-linefeed] [?\M-\n]) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
307 (define-key function-key-map [M-clear] [?\M-\013]) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
308 (define-key function-key-map [M-return] [?\M-\015]) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
309 (define-key function-key-map [M-escape] [?\M-\e]) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
310 |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
311 ;; These don't do the right thing (voelker) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
312 ;(define-key function-key-map [backspace] [127]) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
313 ;(define-key function-key-map [delete] [127]) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
314 ;(define-key function-key-map [M-backspace] [?\M-\d]) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
315 ;(define-key function-key-map [M-delete] [?\M-\d]) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
316 |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
317 ;; These tell read-char how to convert |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
318 ;; these special chars to ASCII. |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
319 (put 'tab 'ascii-character ?\t) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
320 (put 'linefeed 'ascii-character ?\n) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
321 (put 'clear 'ascii-character 12) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
322 (put 'return 'ascii-character 13) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
323 (put 'escape 'ascii-character ?\e) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
324 (put 'backspace 'ascii-character 127) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
325 (put 'delete 'ascii-character 127) |
4b8ff0021dcb
Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents:
17549
diff
changeset
|
326 |
16592
a5e9fa379097
Use new file name w32-fns.el
Geoff Voelker <voelker@cs.washington.edu>
parents:
16028
diff
changeset
|
327 ;;; w32-fns.el ends here |