Mercurial > emacs
annotate lisp/term/w32-win.el @ 97642:4332a13750d7
(x-gtk-map-stock): Don't let the tool bar destroy
match data in process filters.
author | Nick Roberts <nickrob@snap.net.nz> |
---|---|
date | Sat, 23 Aug 2008 15:50:06 +0000 |
parents | 6e551caf98f6 |
children | c2ce87cec47b |
rev | line source |
---|---|
38431
853c3674f20a
Fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38241
diff
changeset
|
1 ;;; w32-win.el --- parse switches controlling interface with W32 window system |
14170
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
2 |
74509 | 3 ;; Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004, |
79718 | 4 ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
13434 | 5 |
6 ;; Author: Kevin Gallo | |
7 ;; Keywords: terminals | |
8 | |
14170
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
9 ;; This file is part of GNU Emacs. |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
10 |
94671
f3ab0c2464f5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
91507
diff
changeset
|
11 ;; GNU Emacs is free software: you can redistribute it and/or modify |
14170
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
12 ;; it under the terms of the GNU General Public License as published by |
94671
f3ab0c2464f5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
91507
diff
changeset
|
13 ;; the Free Software Foundation, either version 3 of the License, or |
f3ab0c2464f5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
91507
diff
changeset
|
14 ;; (at your option) any later version. |
14170
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
15 |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
16 ;; GNU Emacs is distributed in the hope that it will be useful, |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
19 ;; GNU General Public License for more details. |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
20 |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
21 ;; You should have received a copy of the GNU General Public License |
94671
f3ab0c2464f5
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
91507
diff
changeset
|
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
13434 | 23 |
24 ;;; Commentary: | |
25 | |
16889
8de32e992e4d
Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16596
diff
changeset
|
26 ;; w32-win.el: this file is loaded from ../lisp/startup.el when it recognizes |
8de32e992e4d
Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16596
diff
changeset
|
27 ;; that W32 windows are to be used. Command line switches are parsed and those |
8de32e992e4d
Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16596
diff
changeset
|
28 ;; pertaining to W32 are processed and removed from the command line. The |
8de32e992e4d
Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16596
diff
changeset
|
29 ;; W32 display is opened and hooks are set for popping up the initial window. |
13434 | 30 |
31 ;; startup.el will then examine startup files, and eventually call the hooks | |
32 ;; which create the first window (s). | |
33 | |
34 ;;; Code: | |
35 | |
36 | |
37 ;; These are the standard X switches from the Xt Initialize.c file of | |
38 ;; Release 4. | |
39 | |
40 ;; Command line Resource Manager string | |
41 | |
42 ;; +rv *reverseVideo | |
43 ;; +synchronous *synchronous | |
44 ;; -background *background | |
45 ;; -bd *borderColor | |
46 ;; -bg *background | |
47 ;; -bordercolor *borderColor | |
48 ;; -borderwidth .borderWidth | |
49 ;; -bw .borderWidth | |
50 ;; -display .display | |
51 ;; -fg *foreground | |
52 ;; -fn *font | |
53 ;; -font *font | |
54 ;; -foreground *foreground | |
55 ;; -geometry .geometry | |
56 ;; -i .iconType | |
57 ;; -itype .iconType | |
58 ;; -iconic .iconic | |
59 ;; -name .name | |
60 ;; -reverse *reverseVideo | |
61 ;; -rv *reverseVideo | |
62 ;; -selectionTimeout .selectionTimeout | |
63 ;; -synchronous *synchronous | |
64 ;; -xrm | |
65 | |
66 ;; An alist of X options and the function which handles them. See | |
67 ;; ../startup.el. | |
68 | |
83587 | 69 ;; (if (not (eq window-system 'w32)) |
70 ;; (error "%s: Loading w32-win.el but not compiled for w32" (invocation-name))) | |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49290
diff
changeset
|
71 |
13434 | 72 (require 'frame) |
73 (require 'mouse) | |
74 (require 'scroll-bar) | |
75 (require 'faces) | |
76 (require 'select) | |
77 (require 'menu-bar) | |
61477
5d9760bd65eb
* term/w32-win.el (dnd): Require dnd
Jan Djärv <jan.h.d@swipnet.se>
parents:
59704
diff
changeset
|
78 (require 'dnd) |
85500
0dcd1f3c9909
* textmodes/reftex.el: Move require easymenu before first use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84795
diff
changeset
|
79 (require 'w32-vars) |
55467 | 80 |
95892
bb82cfdc467f
(mouse-set-font): Remove overridden function.
Jason Rumney <jasonr@gnu.org>
parents:
95841
diff
changeset
|
81 ;; Keep an obsolete alias for w32-focus-frame and w32-select-font in case |
bb82cfdc467f
(mouse-set-font): Remove overridden function.
Jason Rumney <jasonr@gnu.org>
parents:
95841
diff
changeset
|
82 ;; they are used by code outside Emacs. |
84633
74f243cb2274
(w32-focus-frame): Make obsolete alias for x-focus-frame.
Jason Rumney <jasonr@gnu.org>
parents:
83648
diff
changeset
|
83 (define-obsolete-function-alias 'w32-focus-frame 'x-focus-frame "23.1") |
95892
bb82cfdc467f
(mouse-set-font): Remove overridden function.
Jason Rumney <jasonr@gnu.org>
parents:
95841
diff
changeset
|
84 (define-obsolete-function-alias 'w32-select-font 'x-select-font "23.1") |
55467 | 85 |
65258
c50250830b62
(xlfd-regexp-registry-subnum): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
64701
diff
changeset
|
86 (defvar xlfd-regexp-registry-subnum) |
85500
0dcd1f3c9909
* textmodes/reftex.el: Move require easymenu before first use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84795
diff
changeset
|
87 (defvar w32-color-map) ;; defined in w32fns.c |
65258
c50250830b62
(xlfd-regexp-registry-subnum): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
64701
diff
changeset
|
88 |
86289
8a7ed478f7bc
* international/titdic-cnv.el (dos-8+3-filename):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86277
diff
changeset
|
89 (declare-function w32-send-sys-command "w32fns.c") |
8a7ed478f7bc
* international/titdic-cnv.el (dos-8+3-filename):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86277
diff
changeset
|
90 (declare-function set-message-beep "w32console.c") |
65258
c50250830b62
(xlfd-regexp-registry-subnum): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
64701
diff
changeset
|
91 |
42812
c9282c43bb5a
Add comments to avoid future deletion of conditionals that seem
Jason Rumney <jasonr@gnu.org>
parents:
42810
diff
changeset
|
92 ;; Conditional on new-fontset so bootstrapping works on non-GUI compiles |
42810
e0a03741d896
Only require fontset when new-fontset is bound.
Jason Rumney <jasonr@gnu.org>
parents:
42542
diff
changeset
|
93 (if (fboundp 'new-fontset) |
e0a03741d896
Only require fontset when new-fontset is bound.
Jason Rumney <jasonr@gnu.org>
parents:
42542
diff
changeset
|
94 (require 'fontset)) |
15136
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
95 |
42542
691ca802270d
Require fontset unconditionally.
Jason Rumney <jasonr@gnu.org>
parents:
42286
diff
changeset
|
96 ;; The following definition is used for debugging scroll bar events. |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
97 ;(defun w32-handle-scroll-bar-event (event) (interactive "e") (princ event)) |
15136
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
98 |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
99 (defun w32-drag-n-drop-debug (event) |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
100 "Print the drag-n-drop EVENT in a readable form." |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
101 (interactive "e") |
21883
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
102 (princ event)) |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
103 |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
104 (defun w32-drag-n-drop (event) |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
105 "Edit the files listed in the drag-n-drop EVENT. |
21883
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
106 Switch to a buffer editing the last file dropped." |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
107 (interactive "e") |
24664
ce51d492b1ab
(w32-drag-n-drop): Select file in window where
Andrew Innes <andrewi@gnu.org>
parents:
24246
diff
changeset
|
108 (save-excursion |
26573
e219195abf40
(w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents:
24964
diff
changeset
|
109 ;; Make sure the drop target has positive co-ords |
e219195abf40
(w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents:
24964
diff
changeset
|
110 ;; before setting the selected frame - otherwise it |
e219195abf40
(w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents:
24964
diff
changeset
|
111 ;; won't work. <skx@tardis.ed.ac.uk> |
e219195abf40
(w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents:
24964
diff
changeset
|
112 (let* ((window (posn-window (event-start event))) |
e219195abf40
(w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents:
24964
diff
changeset
|
113 (coords (posn-x-y (event-start event))) |
e219195abf40
(w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents:
24964
diff
changeset
|
114 (x (car coords)) |
e219195abf40
(w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents:
24964
diff
changeset
|
115 (y (cdr coords))) |
e219195abf40
(w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents:
24964
diff
changeset
|
116 (if (and (> x 0) (> y 0)) |
e219195abf40
(w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents:
24964
diff
changeset
|
117 (set-frame-selected-window nil window)) |
84795
6aed7b3522e4
* term/w32-win.el (w32-drag-n-drop): Use mapc instead of mapcar.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84633
diff
changeset
|
118 (mapc (lambda (file-name) |
70764
0cfc01cbdd73
(w32-drag-n-drop): Substitute '/' for '\',
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69546
diff
changeset
|
119 (let ((f (subst-char-in-string ?\\ ?/ file-name)) |
0cfc01cbdd73
(w32-drag-n-drop): Substitute '/' for '\',
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69546
diff
changeset
|
120 (coding (or file-name-coding-system |
0cfc01cbdd73
(w32-drag-n-drop): Substitute '/' for '\',
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69546
diff
changeset
|
121 default-file-name-coding-system))) |
0cfc01cbdd73
(w32-drag-n-drop): Substitute '/' for '\',
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69546
diff
changeset
|
122 (setq file-name |
0cfc01cbdd73
(w32-drag-n-drop): Substitute '/' for '\',
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69546
diff
changeset
|
123 (mapconcat 'url-hexify-string |
0cfc01cbdd73
(w32-drag-n-drop): Substitute '/' for '\',
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69546
diff
changeset
|
124 (split-string (encode-coding-string f coding) |
0cfc01cbdd73
(w32-drag-n-drop): Substitute '/' for '\',
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69546
diff
changeset
|
125 "/") |
0cfc01cbdd73
(w32-drag-n-drop): Substitute '/' for '\',
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69546
diff
changeset
|
126 "/"))) |
64701
34bd8e434dd7
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64084
diff
changeset
|
127 (dnd-handle-one-url window 'private |
61477
5d9760bd65eb
* term/w32-win.el (dnd): Require dnd
Jan Djärv <jan.h.d@swipnet.se>
parents:
59704
diff
changeset
|
128 (concat "file:" file-name))) |
55288
e304cb532417
(w32-drag-n-drop): Use x-dnd.el functions.
Jason Rumney <jasonr@gnu.org>
parents:
52401
diff
changeset
|
129 (car (cdr (cdr event))))) |
26573
e219195abf40
(w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents:
24964
diff
changeset
|
130 (raise-frame))) |
21883
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
131 |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
132 (defun w32-drag-n-drop-other-frame (event) |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
133 "Edit the files listed in the drag-n-drop EVENT, in other frames. |
21883
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
134 May create new frames, or reuse existing ones. The frame editing |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
135 the last file dropped is selected." |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
136 (interactive "e") |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
137 (mapcar 'find-file-other-frame (car (cdr (cdr event))))) |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
138 |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
139 ;; Bind the drag-n-drop event. |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
140 (global-set-key [drag-n-drop] 'w32-drag-n-drop) |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
141 (global-set-key [C-drag-n-drop] 'w32-drag-n-drop-other-frame) |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
142 |
23675
8dcfae475b98
([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents:
23636
diff
changeset
|
143 ;; Keyboard layout/language change events |
8dcfae475b98
([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents:
23636
diff
changeset
|
144 ;; For now ignore language-change events; in the future |
8dcfae475b98
([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents:
23636
diff
changeset
|
145 ;; we should switch the Emacs Input Method to match the |
8dcfae475b98
([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents:
23636
diff
changeset
|
146 ;; new layout/language selected by the user. |
8dcfae475b98
([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents:
23636
diff
changeset
|
147 (global-set-key [language-change] 'ignore) |
8dcfae475b98
([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents:
23636
diff
changeset
|
148 |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
149 (defvar x-resource-name) |
97422
6e551caf98f6
Add declarations for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
96830
diff
changeset
|
150 (defvar x-colors) |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
151 |
13434 | 152 |
26736
a0674327c167
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26573
diff
changeset
|
153 (defun xw-defined-colors (&optional frame) |
a0674327c167
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26573
diff
changeset
|
154 "Internal function called by `defined-colors', which see." |
13434 | 155 (or frame (setq frame (selected-frame))) |
59704 | 156 (let ((defined-colors nil)) |
157 (dolist (this-color (or (mapcar 'car w32-color-map) x-colors)) | |
27101
a5791b2ee668
(xw-defined-colors): Call color-supported-p,
Eli Zaretskii <eliz@gnu.org>
parents:
26736
diff
changeset
|
158 (and (color-supported-p this-color frame t) |
96661
0b232de63205
(x-handle-switch, x-handle-name-switch)
Jason Rumney <jasonr@gnu.org>
parents:
95892
diff
changeset
|
159 (setq defined-colors (cons this-color defined-colors)))) |
13434 | 160 defined-colors)) |
161 | |
162 ;;;; Function keys | |
163 | |
83644 | 164 ;;; make f10 activate the real menubar rather than the mini-buffer menu |
165 ;;; navigation feature. | |
95804
ea2762d2d847
* term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents:
94852
diff
changeset
|
166 (defun w32-menu-bar-open (&optional frame) |
83644 | 167 "Start key navigation of the menu bar in FRAME. |
168 | |
95804
ea2762d2d847
* term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents:
94852
diff
changeset
|
169 This initially activates the first menu-bar item, and you can then navigate |
ea2762d2d847
* term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents:
94852
diff
changeset
|
170 with the arrow keys, select a menu entry with the Return key or cancel with |
ea2762d2d847
* term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents:
94852
diff
changeset
|
171 the Escape key. If FRAME has no menu bar, this function does nothing. |
83644 | 172 |
95804
ea2762d2d847
* term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents:
94852
diff
changeset
|
173 If FRAME is nil or not given, use the selected frame. |
ea2762d2d847
* term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents:
94852
diff
changeset
|
174 If FRAME does not have the menu bar enabled, display a text menu using |
ea2762d2d847
* term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents:
94852
diff
changeset
|
175 `tmm-menubar'." |
83644 | 176 (interactive "i") |
95804
ea2762d2d847
* term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents:
94852
diff
changeset
|
177 (if menu-bar-mode |
ea2762d2d847
* term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents:
94852
diff
changeset
|
178 (w32-send-sys-command ?\xf100 frame) |
ea2762d2d847
* term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents:
94852
diff
changeset
|
179 (with-selected-frame (or frame (selected-frame)) |
ea2762d2d847
* term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents:
94852
diff
changeset
|
180 (tmm-menubar)))) |
13434 | 181 |
182 | |
23636
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
183 ;; W32 systems have different fonts than commonly found on X, so |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
184 ;; we define our own standard fontset here. |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
185 (defvar w32-standard-fontset-spec |
24212
36652d90b38f
(w32-standard-fontset-spec): Remove wildcard
Geoff Voelker <voelker@cs.washington.edu>
parents:
24142
diff
changeset
|
186 "-*-Courier New-normal-r-*-*-13-*-*-*-c-*-fontset-standard" |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
187 "String of fontset spec of the standard fontset. |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
188 This defines a fontset consisting of the Courier New variations for |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
189 European languages which are distributed with Windows as |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
190 \"Multilanguage Support\". |
23636
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
191 |
73490
aedc3ce99a17
(x-handle-name-switch): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
70764
diff
changeset
|
192 See the documentation of `create-fontset-from-fontset-spec' for the format.") |
23636
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
193 |
13434 | 194 (defun x-win-suspend-error () |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
195 "Report an error when a suspend is attempted." |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
196 (error "Suspending an Emacs running under W32 makes no sense")) |
13434 | 197 |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
198 (defvar image-library-alist) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
199 |
56107
a5bfa1a26af3
(image-library-alist): Initialize to a known set of probable library names.
Juanma Barranquero <lekktu@gmail.com>
parents:
55467
diff
changeset
|
200 ;;; Set default known names for image libraries |
a5bfa1a26af3
(image-library-alist): Initialize to a known set of probable library names.
Juanma Barranquero <lekktu@gmail.com>
parents:
55467
diff
changeset
|
201 (setq image-library-alist |
79970
e4615708e4e3
(image-library-alist): Prefer libxpm.dll.
Jason Rumney <jasonr@gnu.org>
parents:
79718
diff
changeset
|
202 '((xpm "libxpm.dll" "xpm4.dll" "libXpm-nox4.dll") |
79990
4c9e3f8637a0
(image-library-alist): Prefer libpng12 to libpng13, because
Juanma Barranquero <lekktu@gmail.com>
parents:
79970
diff
changeset
|
203 (png "libpng12d.dll" "libpng12.dll" "libpng.dll" |
4c9e3f8637a0
(image-library-alist): Prefer libpng12 to libpng13, because
Juanma Barranquero <lekktu@gmail.com>
parents:
79970
diff
changeset
|
204 ;; these are libpng 1.2.8 from GTK+ |
4c9e3f8637a0
(image-library-alist): Prefer libpng12 to libpng13, because
Juanma Barranquero <lekktu@gmail.com>
parents:
79970
diff
changeset
|
205 "libpng13d.dll" "libpng13.dll") |
56107
a5bfa1a26af3
(image-library-alist): Initialize to a known set of probable library names.
Juanma Barranquero <lekktu@gmail.com>
parents:
55467
diff
changeset
|
206 (jpeg "jpeg62.dll" "libjpeg.dll" "jpeg-62.dll" "jpeg.dll") |
a5bfa1a26af3
(image-library-alist): Initialize to a known set of probable library names.
Juanma Barranquero <lekktu@gmail.com>
parents:
55467
diff
changeset
|
207 (tiff "libtiff3.dll" "libtiff.dll") |
84633
74f243cb2274
(w32-focus-frame): Make obsolete alias for x-focus-frame.
Jason Rumney <jasonr@gnu.org>
parents:
83648
diff
changeset
|
208 (gif "giflib4.dll" "libungif4.dll" "libungif.dll") |
74f243cb2274
(w32-focus-frame): Make obsolete alias for x-focus-frame.
Jason Rumney <jasonr@gnu.org>
parents:
83648
diff
changeset
|
209 (svg "librsvg-2-2.dll") |
74f243cb2274
(w32-focus-frame): Make obsolete alias for x-focus-frame.
Jason Rumney <jasonr@gnu.org>
parents:
83648
diff
changeset
|
210 (gdk-pixbuf "libgdk_pixbuf-2.0-0.dll") |
74f243cb2274
(w32-focus-frame): Make obsolete alias for x-focus-frame.
Jason Rumney <jasonr@gnu.org>
parents:
83648
diff
changeset
|
211 (glib "libglib-2.0-0.dll"))) |
56107
a5bfa1a26af3
(image-library-alist): Initialize to a known set of probable library names.
Juanma Barranquero <lekktu@gmail.com>
parents:
55467
diff
changeset
|
212 |
83605
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
213 ;;; multi-tty support |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
214 (defvar w32-initialized nil |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
215 "Non-nil if the w32 window system has been initialized.") |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
216 |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
217 (declare-function x-open-connection "w32fns.c" |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
218 (display &optional xrm-string must-succeed)) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
219 |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
220 (declare-function setup-default-fontset "fontset" ()) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
221 (declare-function set-fontset-font "fontset.c" |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
222 (name target font-spec &optional frame add)) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
223 (declare-function setup-default-fontset "fontset" ()) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
224 (declare-function create-fontset-from-fontset-spec "fontset" |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
225 (fontset-spec &optional style-variant noerror)) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
226 (declare-function create-fontset-from-x-resource "fontset" ()) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
227 (declare-function x-get-resource "frame.c" |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
228 (attribute class &optional component subclass)) |
97422
6e551caf98f6
Add declarations for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
96830
diff
changeset
|
229 (declare-function x-handle-args "common-win" (args)) |
6e551caf98f6
Add declarations for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
96830
diff
changeset
|
230 (declare-function x-parse-geometry "frame.c" (string)) |
6e551caf98f6
Add declarations for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
96830
diff
changeset
|
231 (defvar x-command-line-resources) |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
232 |
83587 | 233 (defun w32-initialize-window-system () |
234 "Initialize Emacs for W32 GUI frames." | |
83598
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
235 |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
236 ;; Do the actual Windows setup here; the above code just defines |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
237 ;; functions and variables that we use now. |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
238 |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
239 (setq command-line-args (x-handle-args command-line-args)) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
240 |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
241 ;; Make sure we have a valid resource name. |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
242 (or (stringp x-resource-name) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
243 (setq x-resource-name |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
244 ;; Change any . or * characters in x-resource-name to hyphens, |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
245 ;; so as not to choke when we use it in X resource queries. |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
246 (replace-regexp-in-string "[.*]" "-" (invocation-name)))) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
247 |
83605
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
248 (x-open-connection "" x-command-line-resources |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
249 ;; Exit with a fatal error if this fails and we |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
250 ;; are the initial display |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
251 (eq initial-window-system 'w32)) |
83598
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
252 |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
253 ;; Setup the default fontset. |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
254 (setup-default-fontset) |
86000
9ffd7a9238e9
(w32-initialize-window-system): Move SJIS font setup here from global scope.
Jason Rumney <jasonr@gnu.org>
parents:
85500
diff
changeset
|
255 |
9ffd7a9238e9
(w32-initialize-window-system): Move SJIS font setup here from global scope.
Jason Rumney <jasonr@gnu.org>
parents:
85500
diff
changeset
|
256 ;; Enable Japanese fonts on Windows to be used by default. |
91095
988512d3a552
(w32-initialize-window-system): Use t, not nil to signify default fontset.
Jason Rumney <jasonr@gnu.org>
parents:
91085
diff
changeset
|
257 (set-fontset-font t (make-char 'katakana-jisx0201) |
86000
9ffd7a9238e9
(w32-initialize-window-system): Move SJIS font setup here from global scope.
Jason Rumney <jasonr@gnu.org>
parents:
85500
diff
changeset
|
258 '("*" . "JISX0208-SJIS")) |
91095
988512d3a552
(w32-initialize-window-system): Use t, not nil to signify default fontset.
Jason Rumney <jasonr@gnu.org>
parents:
91085
diff
changeset
|
259 (set-fontset-font t (make-char 'latin-jisx0201) |
86000
9ffd7a9238e9
(w32-initialize-window-system): Move SJIS font setup here from global scope.
Jason Rumney <jasonr@gnu.org>
parents:
85500
diff
changeset
|
260 '("*" . "JISX0208-SJIS")) |
91095
988512d3a552
(w32-initialize-window-system): Use t, not nil to signify default fontset.
Jason Rumney <jasonr@gnu.org>
parents:
91085
diff
changeset
|
261 (set-fontset-font t (make-char 'japanese-jisx0208) |
86000
9ffd7a9238e9
(w32-initialize-window-system): Move SJIS font setup here from global scope.
Jason Rumney <jasonr@gnu.org>
parents:
85500
diff
changeset
|
262 '("*" . "JISX0208-SJIS")) |
91095
988512d3a552
(w32-initialize-window-system): Use t, not nil to signify default fontset.
Jason Rumney <jasonr@gnu.org>
parents:
91085
diff
changeset
|
263 (set-fontset-font t (make-char 'japanese-jisx0208-1978) |
86000
9ffd7a9238e9
(w32-initialize-window-system): Move SJIS font setup here from global scope.
Jason Rumney <jasonr@gnu.org>
parents:
85500
diff
changeset
|
264 '("*" . "JISX0208-SJIS")) |
9ffd7a9238e9
(w32-initialize-window-system): Move SJIS font setup here from global scope.
Jason Rumney <jasonr@gnu.org>
parents:
85500
diff
changeset
|
265 |
83598
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
266 ;; Create the standard fontset. |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
267 (create-fontset-from-fontset-spec w32-standard-fontset-spec t) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
268 ;; Create fontset specified in X resources "Fontset-N" (N is 0, 1,...). |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
269 (create-fontset-from-x-resource) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
270 |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
271 ;; Apply a geometry resource to the initial frame. Put it at the end |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
272 ;; of the alist, so that anything specified on the command line takes |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
273 ;; precedence. |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
274 (let* ((res-geometry (x-get-resource "geometry" "Geometry")) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
275 parsed) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
276 (if res-geometry |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
277 (progn |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
278 (setq parsed (x-parse-geometry res-geometry)) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
279 ;; If the resource specifies a position, |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
280 ;; call the position and size "user-specified". |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
281 (if (or (assq 'top parsed) (assq 'left parsed)) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
282 (setq parsed (cons '(user-position . t) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
283 (cons '(user-size . t) parsed)))) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
284 ;; All geometry parms apply to the initial frame. |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
285 (setq initial-frame-alist (append initial-frame-alist parsed)) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
286 ;; The size parms apply to all frames. |
96661
0b232de63205
(x-handle-switch, x-handle-name-switch)
Jason Rumney <jasonr@gnu.org>
parents:
95892
diff
changeset
|
287 (if (and (assq 'height parsed) |
0b232de63205
(x-handle-switch, x-handle-name-switch)
Jason Rumney <jasonr@gnu.org>
parents:
95892
diff
changeset
|
288 (not (assq 'height default-frame-alist))) |
0b232de63205
(x-handle-switch, x-handle-name-switch)
Jason Rumney <jasonr@gnu.org>
parents:
95892
diff
changeset
|
289 (setq default-frame-alist |
0b232de63205
(x-handle-switch, x-handle-name-switch)
Jason Rumney <jasonr@gnu.org>
parents:
95892
diff
changeset
|
290 (cons (cons 'height (cdr (assq 'height parsed))) |
0b232de63205
(x-handle-switch, x-handle-name-switch)
Jason Rumney <jasonr@gnu.org>
parents:
95892
diff
changeset
|
291 default-frame-alist)) |
0b232de63205
(x-handle-switch, x-handle-name-switch)
Jason Rumney <jasonr@gnu.org>
parents:
95892
diff
changeset
|
292 (if (and (assq 'width parsed) |
0b232de63205
(x-handle-switch, x-handle-name-switch)
Jason Rumney <jasonr@gnu.org>
parents:
95892
diff
changeset
|
293 (not (assq 'width default-frame-alist))) |
0b232de63205
(x-handle-switch, x-handle-name-switch)
Jason Rumney <jasonr@gnu.org>
parents:
95892
diff
changeset
|
294 (setq default-frame-alist |
0b232de63205
(x-handle-switch, x-handle-name-switch)
Jason Rumney <jasonr@gnu.org>
parents:
95892
diff
changeset
|
295 (cons (cons 'width (cdr (assq 'width parsed))) |
0b232de63205
(x-handle-switch, x-handle-name-switch)
Jason Rumney <jasonr@gnu.org>
parents:
95892
diff
changeset
|
296 default-frame-alist))))))) |
83598
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
297 |
83605
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
298 ;; Check the reverseVideo resource. |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
299 (let ((case-fold-search t)) |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
300 (let ((rv (x-get-resource "reverseVideo" "ReverseVideo"))) |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
301 (if (and rv (string-match "^\\(true\\|yes\\|on\\)$" rv)) |
96661
0b232de63205
(x-handle-switch, x-handle-name-switch)
Jason Rumney <jasonr@gnu.org>
parents:
95892
diff
changeset
|
302 (setq default-frame-alist |
0b232de63205
(x-handle-switch, x-handle-name-switch)
Jason Rumney <jasonr@gnu.org>
parents:
95892
diff
changeset
|
303 (cons '(reverse . t) default-frame-alist))))) |
83605
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
304 |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
305 ;; Don't let Emacs suspend under w32 gui |
83598
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
306 (add-hook 'suspend-hook 'x-win-suspend-error) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
307 |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
308 ;; Turn off window-splitting optimization; w32 is usually fast enough |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
309 ;; that this is only annoying. |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
310 (setq split-window-keep-point t) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
311 |
83605
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
312 ;; Turn on support for mouse wheels |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
313 (mouse-wheel-mode 1) |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
314 |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
315 ;; W32 expects the menu bar cut and paste commands to use the clipboard. |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
316 (menu-bar-enable-clipboard) |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
317 |
83598
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
318 ;; Don't show the frame name; that's redundant. |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
319 (setq-default mode-line-frame-identification " ") |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
320 |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
321 ;; Set to a system sound if you want a fancy bell. |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
322 (set-message-beep 'ok) |
83605
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
323 (setq w32-initialized t)) |
83587 | 324 |
325 (add-to-list 'handle-args-function-alist '(w32 . x-handle-args)) | |
326 (add-to-list 'frame-creation-function-alist '(w32 . x-create-frame-with-faces)) | |
327 (add-to-list 'window-system-initialization-alist '(w32 . w32-initialize-window-system)) | |
328 | |
329 (provide 'w32-win) | |
56107
a5bfa1a26af3
(image-library-alist): Initialize to a known set of probable library names.
Juanma Barranquero <lekktu@gmail.com>
parents:
55467
diff
changeset
|
330 |
59704 | 331 ;; arch-tag: 69fb1701-28c2-4890-b351-3d1fe4b4f166 |
16889
8de32e992e4d
Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16596
diff
changeset
|
332 ;;; w32-win.el ends here |