aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoff Voelker1998-04-17 05:03:43 +0000
committerGeoff Voelker1998-04-17 05:03:43 +0000
commit85f568ec2d2ba454f4f202b7dfcc7721af34cdd5 (patch)
treeb992c4254aac8e4e7a90defbae2a77cb81c35add
parent5edd6aeeb5c7d49a910e4dc2e40426e3c98a172b (diff)
downloademacs-85f568ec2d2ba454f4f202b7dfcc7721af34cdd5.tar.gz
emacs-85f568ec2d2ba454f4f202b7dfcc7721af34cdd5.zip
(w32-system-shells): Add 4dos and 4nt.
(w32-allow-system-shell, w32-valid-locales): New variable. (w32-check-shell-configuration): Make interactive. Obey w32-allow-system-shell. (w32-get-valid-locale-ids, w32-list-locales): New functions. (w32-init-info): Fix relative path to info directory.
-rw-r--r--lisp/w32-fns.el55
1 files changed, 53 insertions, 2 deletions
diff --git a/lisp/w32-fns.el b/lisp/w32-fns.el
index 728863ddfd5..84f2af69323 100644
--- a/lisp/w32-fns.el
+++ b/lisp/w32-fns.el
@@ -46,7 +46,9 @@
46;; same buffer. 46;; same buffer.
47(setq find-file-visit-truename t) 47(setq find-file-visit-truename t)
48 48
49(defvar w32-system-shells '("cmd" "cmd.exe" "command" "command.com") 49(defvar w32-system-shells '("cmd" "cmd.exe" "command" "command.com"
50 "4nt" "4nt.exe" "4dos" "4dos.exe"
51 "ndos" "ndos.exe")
50 "List of strings recognized as Windows NT/9X system shells.") 52 "List of strings recognized as Windows NT/9X system shells.")
51 53
52(defun w32-using-nt () 54(defun w32-using-nt ()
@@ -66,11 +68,15 @@
66 (member (downcase (file-name-nondirectory shell-name)) 68 (member (downcase (file-name-nondirectory shell-name))
67 w32-system-shells))) 69 w32-system-shells)))
68 70
71(defvar w32-allow-system-shell nil
72 "*Disable startup warning when using \"system\" shells.")
73
69(defun w32-check-shell-configuration () 74(defun w32-check-shell-configuration ()
70 "Check the configuration of shell variables on Windows NT/9X. 75 "Check the configuration of shell variables on Windows NT/9X.
71This function is invoked after loading the init files and processing 76This function is invoked after loading the init files and processing
72the command line arguments. It issues a warning if the user or site 77the command line arguments. It issues a warning if the user or site
73has configured the shell with inappropriate settings." 78has configured the shell with inappropriate settings."
79 (interactive)
74 (let ((prev-buffer (current-buffer)) 80 (let ((prev-buffer (current-buffer))
75 (buffer (get-buffer-create "*Shell Configuration*")) 81 (buffer (get-buffer-create "*Shell Configuration*"))
76 (system-shell)) 82 (system-shell))
@@ -94,6 +100,13 @@ You probably want to change it so that it uses cmdproxy.exe instead.\n\n"
94You probably want to change it so that it uses cmdproxy.exe instead.\n\n" 100You probably want to change it so that it uses cmdproxy.exe instead.\n\n"
95 explicit-shell-file-name))) 101 explicit-shell-file-name)))
96 (setq system-shell (> (buffer-size) 0)) 102 (setq system-shell (> (buffer-size) 0))
103
104 ;; Allow user to specify that they really do want to use one of the
105 ;; "system" shells, despite the drawbacks, but still warn if
106 ;; shell-command-switch doesn't match.
107 (if w32-allow-system-shell
108 (erase-buffer))
109
97 (cond (system-shell 110 (cond (system-shell
98 ;; System shells. 111 ;; System shells.
99 (if (string-equal "-c" shell-command-switch) 112 (if (string-equal "-c" shell-command-switch)
@@ -117,6 +130,44 @@ You should set this to t when using a non-system shell.\n\n"))))
117 130
118(add-hook 'after-init-hook 'w32-check-shell-configuration) 131(add-hook 'after-init-hook 'w32-check-shell-configuration)
119 132
133
134;;; Basic support functions for managing Emacs' locale setting
135
136(defvar w32-valid-locales nil
137 "List of locale ids known to be supported.")
138
139;;; This is the brute-force version; an efficient version is now
140;;; built-in though.
141(if (not (fboundp 'w32-get-valid-locale-ids))
142 (defun w32-get-valid-locale-ids ()
143 "Return list of all valid Windows locale ids."
144 (let ((i 65535)
145 locales)
146 (while (> i 0)
147 (if (w32-get-locale-info i)
148 (setq locales (cons i locales)))
149 (setq i (1- i)))
150 locales)))
151
152(defun w32-list-locales ()
153 "List the name and id of all locales supported by Windows."
154 (interactive)
155 (if (null w32-valid-locales)
156 (setq w32-valid-locales (w32-get-valid-locale-ids)))
157 (switch-to-buffer-other-window (get-buffer-create "*Supported Locales*"))
158 (erase-buffer)
159 (insert "LCID\tAbbrev\tFull name\n\n")
160 (insert (mapconcat
161 '(lambda (x)
162 (format "%d\t%s\t%s"
163 x
164 (w32-get-locale-info x)
165 (w32-get-locale-info x t)))
166 w32-valid-locales "\n"))
167 (insert "\n")
168 (goto-char (point-min)))
169
170
120;;; Setup Info-default-directory-list to include the info directory 171;;; Setup Info-default-directory-list to include the info directory
121;;; near where Emacs executable was installed. We used to set INFOPATH, 172;;; near where Emacs executable was installed. We used to set INFOPATH,
122;;; but when this is set Info-default-directory-list is ignored. We 173;;; but when this is set Info-default-directory-list is ignored. We
@@ -124,7 +175,7 @@ You should set this to t when using a non-system shell.\n\n"))))
124;;; that configuration during build time is correct for runtime. 175;;; that configuration during build time is correct for runtime.
125(defun w32-init-info () 176(defun w32-init-info ()
126 (let* ((instdir (file-name-directory invocation-directory)) 177 (let* ((instdir (file-name-directory invocation-directory))
127 (dir1 (expand-file-name "info/" instdir)) 178 (dir1 (expand-file-name "../info/" instdir))
128 (dir2 (expand-file-name "../../../info/" instdir))) 179 (dir2 (expand-file-name "../../../info/" instdir)))
129 (if (file-exists-p dir1) 180 (if (file-exists-p dir1)
130 (setq Info-default-directory-list 181 (setq Info-default-directory-list