Mercurial > emacs
annotate lisp/term/w32-win.el @ 100327:5d74aae1daad
Improve comments for last change.
author | Jason Rumney <jasonr@gnu.org> |
---|---|
date | Wed, 10 Dec 2008 16:21:39 +0000 |
parents | c2ce87cec47b |
children | 06da6fdc594a |
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") |
99714 | 84 (declare-function x-select-font "w32font.c" |
85 (&optional frame exclude-proportional)) | |
95892
bb82cfdc467f
(mouse-set-font): Remove overridden function.
Jason Rumney <jasonr@gnu.org>
parents:
95841
diff
changeset
|
86 (define-obsolete-function-alias 'w32-select-font 'x-select-font "23.1") |
55467 | 87 |
65258
c50250830b62
(xlfd-regexp-registry-subnum): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
64701
diff
changeset
|
88 (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
|
89 (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
|
90 |
86289
8a7ed478f7bc
* international/titdic-cnv.el (dos-8+3-filename):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86277
diff
changeset
|
91 (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
|
92 (declare-function set-message-beep "w32console.c") |
65258
c50250830b62
(xlfd-regexp-registry-subnum): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
64701
diff
changeset
|
93 |
42812
c9282c43bb5a
Add comments to avoid future deletion of conditionals that seem
Jason Rumney <jasonr@gnu.org>
parents:
42810
diff
changeset
|
94 ;; 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
|
95 (if (fboundp 'new-fontset) |
e0a03741d896
Only require fontset when new-fontset is bound.
Jason Rumney <jasonr@gnu.org>
parents:
42542
diff
changeset
|
96 (require 'fontset)) |
15136
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
97 |
42542
691ca802270d
Require fontset unconditionally.
Jason Rumney <jasonr@gnu.org>
parents:
42286
diff
changeset
|
98 ;; 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
|
99 ;(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
|
100 |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
101 (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
|
102 "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
|
103 (interactive "e") |
21883
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
104 (princ event)) |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
105 |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
106 (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
|
107 "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
|
108 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
|
109 (interactive "e") |
24664
ce51d492b1ab
(w32-drag-n-drop): Select file in window where
Andrew Innes <andrewi@gnu.org>
parents:
24246
diff
changeset
|
110 (save-excursion |
26573
e219195abf40
(w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents:
24964
diff
changeset
|
111 ;; 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
|
112 ;; 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
|
113 ;; 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
|
114 (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
|
115 (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
|
116 (x (car coords)) |
e219195abf40
(w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents:
24964
diff
changeset
|
117 (y (cdr coords))) |
e219195abf40
(w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents:
24964
diff
changeset
|
118 (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
|
119 (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
|
120 (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
|
121 (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
|
122 (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
|
123 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
|
124 (setq file-name |
0cfc01cbdd73
(w32-drag-n-drop): Substitute '/' for '\',
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69546
diff
changeset
|
125 (mapconcat 'url-hexify-string |
0cfc01cbdd73
(w32-drag-n-drop): Substitute '/' for '\',
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69546
diff
changeset
|
126 (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
|
127 "/") |
0cfc01cbdd73
(w32-drag-n-drop): Substitute '/' for '\',
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69546
diff
changeset
|
128 "/"))) |
64701
34bd8e434dd7
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64084
diff
changeset
|
129 (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
|
130 (concat "file:" file-name))) |
55288
e304cb532417
(w32-drag-n-drop): Use x-dnd.el functions.
Jason Rumney <jasonr@gnu.org>
parents:
52401
diff
changeset
|
131 (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
|
132 (raise-frame))) |
21883
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
133 |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
134 (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
|
135 "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
|
136 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
|
137 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
|
138 (interactive "e") |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
139 (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
|
140 |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
141 ;; 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
|
142 (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
|
143 (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
|
144 |
23675
8dcfae475b98
([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents:
23636
diff
changeset
|
145 ;; Keyboard layout/language change events |
8dcfae475b98
([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents:
23636
diff
changeset
|
146 ;; 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
|
147 ;; 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
|
148 ;; new layout/language selected by the user. |
8dcfae475b98
([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents:
23636
diff
changeset
|
149 (global-set-key [language-change] 'ignore) |
8dcfae475b98
([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents:
23636
diff
changeset
|
150 |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
151 (defvar x-resource-name) |
97422
6e551caf98f6
Add declarations for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
96830
diff
changeset
|
152 (defvar x-colors) |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
153 |
13434 | 154 |
26736
a0674327c167
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26573
diff
changeset
|
155 (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
|
156 "Internal function called by `defined-colors', which see." |
13434 | 157 (or frame (setq frame (selected-frame))) |
59704 | 158 (let ((defined-colors nil)) |
159 (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
|
160 (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
|
161 (setq defined-colors (cons this-color defined-colors)))) |
13434 | 162 defined-colors)) |
163 | |
164 ;;;; Function keys | |
165 | |
83644 | 166 ;;; make f10 activate the real menubar rather than the mini-buffer menu |
167 ;;; 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
|
168 (defun w32-menu-bar-open (&optional frame) |
83644 | 169 "Start key navigation of the menu bar in FRAME. |
170 | |
95804
ea2762d2d847
* term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents:
94852
diff
changeset
|
171 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
|
172 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
|
173 the Escape key. If FRAME has no menu bar, this function does nothing. |
83644 | 174 |
95804
ea2762d2d847
* term/w32-win.el (w32-menu-bar-open): Rename from menu-bar-open.
Jason Rumney <jasonr@gnu.org>
parents:
94852
diff
changeset
|
175 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
|
176 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
|
177 `tmm-menubar'." |
83644 | 178 (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
|
179 (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
|
180 (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
|
181 (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
|
182 (tmm-menubar)))) |
13434 | 183 |
184 | |
23636
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
185 ;; 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
|
186 ;; we define our own standard fontset here. |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
187 (defvar w32-standard-fontset-spec |
24212
36652d90b38f
(w32-standard-fontset-spec): Remove wildcard
Geoff Voelker <voelker@cs.washington.edu>
parents:
24142
diff
changeset
|
188 "-*-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
|
189 "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
|
190 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
|
191 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
|
192 \"Multilanguage Support\". |
23636
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
193 |
73490
aedc3ce99a17
(x-handle-name-switch): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
70764
diff
changeset
|
194 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
|
195 |
13434 | 196 (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
|
197 "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
|
198 (error "Suspending an Emacs running under W32 makes no sense")) |
13434 | 199 |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
200 (defvar image-library-alist) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
201 |
56107
a5bfa1a26af3
(image-library-alist): Initialize to a known set of probable library names.
Juanma Barranquero <lekktu@gmail.com>
parents:
55467
diff
changeset
|
202 ;;; 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
|
203 (setq image-library-alist |
79970
e4615708e4e3
(image-library-alist): Prefer libxpm.dll.
Jason Rumney <jasonr@gnu.org>
parents:
79718
diff
changeset
|
204 '((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
|
205 (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
|
206 ;; 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
|
207 "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
|
208 (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
|
209 (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
|
210 (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
|
211 (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
|
212 (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
|
213 (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
|
214 |
83605
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
215 ;;; multi-tty support |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
216 (defvar w32-initialized nil |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
217 "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
|
218 |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
219 (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
|
220 (display &optional xrm-string must-succeed)) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
221 |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
222 (declare-function setup-default-fontset "fontset" ()) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
223 (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
|
224 (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
|
225 (declare-function setup-default-fontset "fontset" ()) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
226 (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
|
227 (fontset-spec &optional style-variant noerror)) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
228 (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
|
229 (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
|
230 (attribute class &optional component subclass)) |
97422
6e551caf98f6
Add declarations for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
96830
diff
changeset
|
231 (declare-function x-handle-args "common-win" (args)) |
6e551caf98f6
Add declarations for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
96830
diff
changeset
|
232 (declare-function x-parse-geometry "frame.c" (string)) |
6e551caf98f6
Add declarations for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
96830
diff
changeset
|
233 (defvar x-command-line-resources) |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
95804
diff
changeset
|
234 |
83587 | 235 (defun w32-initialize-window-system () |
236 "Initialize Emacs for W32 GUI frames." | |
83598
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
237 |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
238 ;; 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
|
239 ;; functions and variables that we use now. |
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 (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
|
242 |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
243 ;; Make sure we have a valid resource name. |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
244 (or (stringp x-resource-name) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
245 (setq x-resource-name |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
246 ;; 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
|
247 ;; 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
|
248 (replace-regexp-in-string "[.*]" "-" (invocation-name)))) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
249 |
83605
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
250 (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
|
251 ;; 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
|
252 ;; are the initial display |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
253 (eq initial-window-system 'w32)) |
83598
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
254 |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
255 ;; Setup the default fontset. |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
256 (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
|
257 |
9ffd7a9238e9
(w32-initialize-window-system): Move SJIS font setup here from global scope.
Jason Rumney <jasonr@gnu.org>
parents:
85500
diff
changeset
|
258 ;; 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
|
259 (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
|
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 '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
|
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) |
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")) |
91095
988512d3a552
(w32-initialize-window-system): Use t, not nil to signify default fontset.
Jason Rumney <jasonr@gnu.org>
parents:
91085
diff
changeset
|
265 (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
|
266 '("*" . "JISX0208-SJIS")) |
9ffd7a9238e9
(w32-initialize-window-system): Move SJIS font setup here from global scope.
Jason Rumney <jasonr@gnu.org>
parents:
85500
diff
changeset
|
267 |
83598
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
268 ;; Create the standard fontset. |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
269 (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
|
270 ;; 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
|
271 (create-fontset-from-x-resource) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
272 |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
273 ;; 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
|
274 ;; 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
|
275 ;; precedence. |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
276 (let* ((res-geometry (x-get-resource "geometry" "Geometry")) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
277 parsed) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
278 (if res-geometry |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
279 (progn |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
280 (setq parsed (x-parse-geometry res-geometry)) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
281 ;; If the resource specifies a position, |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
282 ;; call the position and size "user-specified". |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
283 (if (or (assq 'top parsed) (assq 'left parsed)) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
284 (setq parsed (cons '(user-position . t) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
285 (cons '(user-size . t) parsed)))) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
286 ;; All geometry parms apply to the initial frame. |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
287 (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
|
288 ;; 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
|
289 (if (and (assq 'height parsed) |
0b232de63205
(x-handle-switch, x-handle-name-switch)
Jason Rumney <jasonr@gnu.org>
parents:
95892
diff
changeset
|
290 (not (assq 'height default-frame-alist))) |
0b232de63205
(x-handle-switch, x-handle-name-switch)
Jason Rumney <jasonr@gnu.org>
parents:
95892
diff
changeset
|
291 (setq default-frame-alist |
0b232de63205
(x-handle-switch, x-handle-name-switch)
Jason Rumney <jasonr@gnu.org>
parents:
95892
diff
changeset
|
292 (cons (cons 'height (cdr (assq 'height parsed))) |
0b232de63205
(x-handle-switch, x-handle-name-switch)
Jason Rumney <jasonr@gnu.org>
parents:
95892
diff
changeset
|
293 default-frame-alist)) |
0b232de63205
(x-handle-switch, x-handle-name-switch)
Jason Rumney <jasonr@gnu.org>
parents:
95892
diff
changeset
|
294 (if (and (assq 'width parsed) |
0b232de63205
(x-handle-switch, x-handle-name-switch)
Jason Rumney <jasonr@gnu.org>
parents:
95892
diff
changeset
|
295 (not (assq 'width default-frame-alist))) |
0b232de63205
(x-handle-switch, x-handle-name-switch)
Jason Rumney <jasonr@gnu.org>
parents:
95892
diff
changeset
|
296 (setq default-frame-alist |
0b232de63205
(x-handle-switch, x-handle-name-switch)
Jason Rumney <jasonr@gnu.org>
parents:
95892
diff
changeset
|
297 (cons (cons 'width (cdr (assq 'width parsed))) |
0b232de63205
(x-handle-switch, x-handle-name-switch)
Jason Rumney <jasonr@gnu.org>
parents:
95892
diff
changeset
|
298 default-frame-alist))))))) |
83598
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
299 |
83605
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
300 ;; Check the reverseVideo resource. |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
301 (let ((case-fold-search t)) |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
302 (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
|
303 (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
|
304 (setq default-frame-alist |
0b232de63205
(x-handle-switch, x-handle-name-switch)
Jason Rumney <jasonr@gnu.org>
parents:
95892
diff
changeset
|
305 (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
|
306 |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
307 ;; 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
|
308 (add-hook 'suspend-hook 'x-win-suspend-error) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
309 |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
310 ;; 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
|
311 ;; that this is only annoying. |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
312 (setq split-window-keep-point t) |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
313 |
83605
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
314 ;; Turn on support for mouse wheels |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
315 (mouse-wheel-mode 1) |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
316 |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
317 ;; 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
|
318 (menu-bar-enable-clipboard) |
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
319 |
83598
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
320 ;; 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
|
321 (setq-default mode-line-frame-identification " ") |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
322 |
9ebefb43d02d
(x-setup-function-keys): New function.
Jason Rumney <jasonr@gnu.org>
parents:
83587
diff
changeset
|
323 ;; 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
|
324 (set-message-beep 'ok) |
83605
117c33233c18
Reorder to match x-win.el more closely.
Jason Rumney <jasonr@gnu.org>
parents:
83598
diff
changeset
|
325 (setq w32-initialized t)) |
83587 | 326 |
327 (add-to-list 'handle-args-function-alist '(w32 . x-handle-args)) | |
328 (add-to-list 'frame-creation-function-alist '(w32 . x-create-frame-with-faces)) | |
329 (add-to-list 'window-system-initialization-alist '(w32 . w32-initialize-window-system)) | |
330 | |
331 (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
|
332 |
59704 | 333 ;; 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
|
334 ;;; w32-win.el ends here |