aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Rumney2007-05-16 22:49:00 +0000
committerJason Rumney2007-05-16 22:49:00 +0000
commiteacf409f1f3246731f27100d5a927eb5820dfa80 (patch)
tree1050d14fe7139fc31a5c0676622bd5e92439b3b1
parent4335dfda32b7aec2792bec0e70230cd14556901d (diff)
downloademacs-eacf409f1f3246731f27100d5a927eb5820dfa80.tar.gz
emacs-eacf409f1f3246731f27100d5a927eb5820dfa80.zip
Reorder to match x-win.el more closely.
(x-setup-function-keys): Use local-function-key-map. (w32-initialized): New variable. (w32-initialize-window-system): Set it. Move more global setup here.
-rw-r--r--lisp/term/w32-win.el51
1 files changed, 30 insertions, 21 deletions
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index 5bcc1aac822..b594f30ddf6 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -1040,19 +1040,18 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
1040 "Setup Function Keys for w32." 1040 "Setup Function Keys for w32."
1041 ;; make f10 activate the real menubar rather than the mini-buffer menu 1041 ;; make f10 activate the real menubar rather than the mini-buffer menu
1042 ;; navigation feature. 1042 ;; navigation feature.
1043 (global-set-key [f10] (lambda () 1043 (with-selected-frame frame
1044 (interactive) (w32-send-sys-command ?\xf100))) 1044 (define-key local-function-key-map [f10]
1045 (lambda ()
1046 (interactive) (w32-send-sys-command ?\xf100)))
1045 1047
1046 (substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame 1048 (substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame
1047 global-map) 1049 local-function-key-map global-map)
1048 1050
1049 (define-key function-key-map [S-tab] [backtab])) 1051 (define-key local-function-key-map [S-tab] [backtab]))
1052 (set-terminal-parameter frame 'x-setup-function-keys t))
1050 1053
1051 1054
1052;; W32 expects the menu bar cut and paste commands to use the clipboard.
1053;; This has ,? to match both on Sunos and on Solaris.
1054(menu-bar-enable-clipboard)
1055
1056;; W32 systems have different fonts than commonly found on X, so 1055;; W32 systems have different fonts than commonly found on X, so
1057;; we define our own standard fontset here. 1056;; we define our own standard fontset here.
1058(defvar w32-standard-fontset-spec 1057(defvar w32-standard-fontset-spec
@@ -1143,11 +1142,12 @@ pop-up menu are unaffected by `w32-list-proportional-fonts')."
1143 (tiff "libtiff3.dll" "libtiff.dll") 1142 (tiff "libtiff3.dll" "libtiff.dll")
1144 (gif "giflib4.dll" "libungif4.dll" "libungif.dll"))) 1143 (gif "giflib4.dll" "libungif4.dll" "libungif.dll")))
1145 1144
1146;; multi-tty support 1145;;; multi-tty support
1146(defvar w32-initialized nil
1147 "Non-nil if the w32 window system has been initialized.")
1148
1147(defun w32-initialize-window-system () 1149(defun w32-initialize-window-system ()
1148 "Initialize Emacs for W32 GUI frames." 1150 "Initialize Emacs for W32 GUI frames."
1149 ;; Handle mouse-wheel events with mwheel.
1150 (mouse-wheel-mode 1)
1151 1151
1152 ;; Do the actual Windows setup here; the above code just defines 1152 ;; Do the actual Windows setup here; the above code just defines
1153 ;; functions and variables that we use now. 1153 ;; functions and variables that we use now.
@@ -1161,9 +1161,10 @@ pop-up menu are unaffected by `w32-list-proportional-fonts')."
1161 ;; so as not to choke when we use it in X resource queries. 1161 ;; so as not to choke when we use it in X resource queries.
1162 (replace-regexp-in-string "[.*]" "-" (invocation-name)))) 1162 (replace-regexp-in-string "[.*]" "-" (invocation-name))))
1163 1163
1164 (x-open-connection "" x-command-line-resources t) 1164 (x-open-connection "" x-command-line-resources
1165 1165 ;; Exit with a fatal error if this fails and we
1166 (setq frame-creation-function 'x-create-frame-with-faces) 1166 ;; are the initial display
1167 (eq initial-window-system 'w32))
1167 1168
1168 ;; Setup the default fontset. 1169 ;; Setup the default fontset.
1169 (setup-default-fontset) 1170 (setup-default-fontset)
@@ -1219,23 +1220,31 @@ pop-up menu are unaffected by `w32-list-proportional-fonts')."
1219 (push (cons 'width (cdr (assq 'width parsed))) 1220 (push (cons 'width (cdr (assq 'width parsed)))
1220 default-frame-alist))))) 1221 default-frame-alist)))))
1221 1222
1223 ;; Check the reverseVideo resource.
1224 (let ((case-fold-search t))
1225 (let ((rv (x-get-resource "reverseVideo" "ReverseVideo")))
1226 (if (and rv (string-match "^\\(true\\|yes\\|on\\)$" rv))
1227 (push '(reverse . t) default-frame-alist))))
1228
1229 ;; Don't let Emacs suspend under w32 gui
1222 (add-hook 'suspend-hook 'x-win-suspend-error) 1230 (add-hook 'suspend-hook 'x-win-suspend-error)
1223 1231
1224 ;; Turn off window-splitting optimization; w32 is usually fast enough 1232 ;; Turn off window-splitting optimization; w32 is usually fast enough
1225 ;; that this is only annoying. 1233 ;; that this is only annoying.
1226 (setq split-window-keep-point t) 1234 (setq split-window-keep-point t)
1227 1235
1236 ;; Turn on support for mouse wheels
1237 (mouse-wheel-mode 1)
1238
1239 ;; W32 expects the menu bar cut and paste commands to use the clipboard.
1240 (menu-bar-enable-clipboard)
1241
1228 ;; Don't show the frame name; that's redundant. 1242 ;; Don't show the frame name; that's redundant.
1229 (setq-default mode-line-frame-identification " ") 1243 (setq-default mode-line-frame-identification " ")
1230 1244
1231 ;; Set to a system sound if you want a fancy bell. 1245 ;; Set to a system sound if you want a fancy bell.
1232 (set-message-beep 'ok) 1246 (set-message-beep 'ok)
1233 1247 (setq w32-initialized t))
1234 ;; Check the reverseVideo resource.
1235 (let ((case-fold-search t))
1236 (let ((rv (x-get-resource "reverseVideo" "ReverseVideo")))
1237 (if (and rv (string-match "^\\(true\\|yes\\|on\\)$" rv))
1238 (push '(reverse . t) default-frame-alist)))))
1239 1248
1240(add-to-list 'handle-args-function-alist '(w32 . x-handle-args)) 1249(add-to-list 'handle-args-function-alist '(w32 . x-handle-args))
1241(add-to-list 'frame-creation-function-alist '(w32 . x-create-frame-with-faces)) 1250(add-to-list 'frame-creation-function-alist '(w32 . x-create-frame-with-faces))