Mercurial > emacs
annotate lisp/term/w32-win.el @ 37857:b3fd27aaa58d
*** empty log message ***
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Mon, 21 May 2001 12:28:26 +0000 |
parents | b47c7b58e497 |
children | c3737c213380 |
rev | line source |
---|---|
16889
8de32e992e4d
Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16596
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 |
13434 | 3 ;; Copyright (C) 1993, 1994 Free Software Foundation, Inc. |
4 | |
5 ;; Author: Kevin Gallo | |
6 ;; Keywords: terminals | |
7 | |
14170
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
8 ;; This file is part of GNU Emacs. |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
9 |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
10 ;; GNU Emacs is free software; you can redistribute it and/or modify |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
11 ;; it under the terms of the GNU General Public License as published by |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
12 ;; the Free Software Foundation; either version 2, or (at your option) |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
13 ;; any later version. |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
14 |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
15 ;; 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
|
16 ;; 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
|
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
18 ;; GNU General Public License for more details. |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
19 |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
20 ;; You should have received a copy of the GNU General Public License |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
13831
diff
changeset
|
23 ;; Boston, MA 02111-1307, USA. |
13434 | 24 |
25 ;;; Commentary: | |
26 | |
16889
8de32e992e4d
Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16596
diff
changeset
|
27 ;; 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
|
28 ;; 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
|
29 ;; 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
|
30 ;; W32 display is opened and hooks are set for popping up the initial window. |
13434 | 31 |
32 ;; startup.el will then examine startup files, and eventually call the hooks | |
33 ;; which create the first window (s). | |
34 | |
35 ;;; Code: | |
36 | |
37 | |
38 ;; These are the standard X switches from the Xt Initialize.c file of | |
39 ;; Release 4. | |
40 | |
41 ;; Command line Resource Manager string | |
42 | |
43 ;; +rv *reverseVideo | |
44 ;; +synchronous *synchronous | |
45 ;; -background *background | |
46 ;; -bd *borderColor | |
47 ;; -bg *background | |
48 ;; -bordercolor *borderColor | |
49 ;; -borderwidth .borderWidth | |
50 ;; -bw .borderWidth | |
51 ;; -display .display | |
52 ;; -fg *foreground | |
53 ;; -fn *font | |
54 ;; -font *font | |
55 ;; -foreground *foreground | |
56 ;; -geometry .geometry | |
57 ;; -i .iconType | |
58 ;; -itype .iconType | |
59 ;; -iconic .iconic | |
60 ;; -name .name | |
61 ;; -reverse *reverseVideo | |
62 ;; -rv *reverseVideo | |
63 ;; -selectionTimeout .selectionTimeout | |
64 ;; -synchronous *synchronous | |
65 ;; -xrm | |
66 | |
67 ;; An alist of X options and the function which handles them. See | |
68 ;; ../startup.el. | |
69 | |
16889
8de32e992e4d
Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16596
diff
changeset
|
70 (if (not (eq window-system 'w32)) |
8de32e992e4d
Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16596
diff
changeset
|
71 (error "%s: Loading w32-win.el but not compiled for w32" (invocation-name))) |
13434 | 72 |
73 (require 'frame) | |
74 (require 'mouse) | |
75 (require 'scroll-bar) | |
76 (require 'faces) | |
77 (require 'select) | |
78 (require 'menu-bar) | |
23625
f91f7d21d4ec
Require fontset.
Geoff Voelker <voelker@cs.washington.edu>
parents:
23560
diff
changeset
|
79 (if (fboundp 'new-fontset) |
f91f7d21d4ec
Require fontset.
Geoff Voelker <voelker@cs.washington.edu>
parents:
23560
diff
changeset
|
80 (require 'fontset)) |
13434 | 81 |
35753
f00dbc5292a9
(redisplay-dont-pause): Set to t to alleviate display problems.
Eli Zaretskii <eliz@gnu.org>
parents:
34370
diff
changeset
|
82 ;; FIXME: this is temporary for v21.1, since many redisplay problems |
f00dbc5292a9
(redisplay-dont-pause): Set to t to alleviate display problems.
Eli Zaretskii <eliz@gnu.org>
parents:
34370
diff
changeset
|
83 ;; happen if redisplay-dont-pause is nil. |
f00dbc5292a9
(redisplay-dont-pause): Set to t to alleviate display problems.
Eli Zaretskii <eliz@gnu.org>
parents:
34370
diff
changeset
|
84 (setq redisplay-dont-pause t) |
f00dbc5292a9
(redisplay-dont-pause): Set to t to alleviate display problems.
Eli Zaretskii <eliz@gnu.org>
parents:
34370
diff
changeset
|
85 |
15136
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
86 ;; Because Windows scrollbars look and act quite differently compared |
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
87 ;; with the standard X scroll-bars, we don't try to use the normal |
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
88 ;; scroll bar routines. |
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
89 |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
90 (defun w32-handle-scroll-bar-event (event) |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
91 "Handle W32 scroll bar EVENT to do normal Window style scrolling." |
15136
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
92 (interactive "e") |
15265
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
93 (let ((old-window (selected-window))) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
94 (unwind-protect |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
95 (let* ((position (event-start event)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
96 (window (nth 0 position)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
97 (portion-whole (nth 2 position)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
98 (bar-part (nth 4 position))) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
99 (save-excursion |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
100 (select-window window) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
101 (cond |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
102 ((eq bar-part 'up) |
19691
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
103 (goto-char (window-start window)) |
15265
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
104 (scroll-down 1)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
105 ((eq bar-part 'above-handle) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
106 (scroll-down)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
107 ((eq bar-part 'handle) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
108 (scroll-bar-maybe-set-window-start event)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
109 ((eq bar-part 'below-handle) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
110 (scroll-up)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
111 ((eq bar-part 'down) |
19691
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
112 (goto-char (window-start window)) |
15265
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
113 (scroll-up 1)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
114 ))) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
115 (select-window old-window)))) |
15136
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
116 |
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
117 ;; The following definition is used for debugging. |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
118 ;(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
|
119 |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
120 (global-set-key [vertical-scroll-bar mouse-1] 'w32-handle-scroll-bar-event) |
15136
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
121 |
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
122 ;; (scroll-bar-mode nil) |
13831
2b90a48bb3db
Disable scrollbars until fully functional.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13434
diff
changeset
|
123 |
19691
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
124 (defvar mouse-wheel-scroll-amount 4 |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
125 "*Number of lines to scroll per click of the mouse wheel.") |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
126 |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
127 (defun mouse-wheel-scroll-line (event) |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
128 "Scroll the window in which EVENT occurred by `mouse-wheel-scroll-amount'." |
19691
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
129 (interactive "e") |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
130 (condition-case nil |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
131 (if (< (car (cdr (cdr event))) 0) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
132 (scroll-up mouse-wheel-scroll-amount) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
133 (scroll-down mouse-wheel-scroll-amount)) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
134 (error nil))) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
135 |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
136 ;; for scroll-in-place.el, this way the -scroll-line and -scroll-screen |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
137 ;; commands won't interact |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
138 (setq scroll-command-groups (list '(mouse-wheel-scroll-line))) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
139 |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
140 (defun mouse-wheel-scroll-screen (event) |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
141 "Scroll the window in which EVENT occurred by `mouse-wheel-scroll-amount'." |
19691
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
142 (interactive "e") |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
143 (condition-case nil |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
144 (if (< (car (cdr (cdr event))) 0) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
145 (scroll-up) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
146 (scroll-down)) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
147 (error nil))) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
148 |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
149 ;; Bind the mouse-wheel event: |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
150 (global-set-key [mouse-wheel] 'mouse-wheel-scroll-line) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
151 (global-set-key [C-mouse-wheel] 'mouse-wheel-scroll-screen) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
152 |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
153 (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
|
154 "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
|
155 (interactive "e") |
21883
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
156 (princ event)) |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
157 |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
158 (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
|
159 "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
|
160 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
|
161 (interactive "e") |
24664
ce51d492b1ab
(w32-drag-n-drop): Select file in window where
Andrew Innes <andrewi@gnu.org>
parents:
24246
diff
changeset
|
162 (save-excursion |
26573
e219195abf40
(w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents:
24964
diff
changeset
|
163 ;; 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
|
164 ;; 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
|
165 ;; 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
|
166 (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
|
167 (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
|
168 (x (car coords)) |
e219195abf40
(w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents:
24964
diff
changeset
|
169 (y (cdr coords))) |
e219195abf40
(w32-drag-n-drop): Load files in current window, if
Gerd Moellmann <gerd@gnu.org>
parents:
24964
diff
changeset
|
170 (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
|
171 (set-frame-selected-window nil window)) |
27404
dc6ba3cab915
(w32_create_initial_fontsets): Disabled as it conflicts with new face support.
Jason Rumney <jasonr@gnu.org>
parents:
27101
diff
changeset
|
172 (mapcar 'find-file (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
|
173 (raise-frame))) |
21883
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
174 |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
175 (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
|
176 "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
|
177 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
|
178 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
|
179 (interactive "e") |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
180 (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
|
181 |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
182 ;; 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
|
183 (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
|
184 (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
|
185 |
23675
8dcfae475b98
([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents:
23636
diff
changeset
|
186 ;; Keyboard layout/language change events |
8dcfae475b98
([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents:
23636
diff
changeset
|
187 ;; 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
|
188 ;; 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
|
189 ;; new layout/language selected by the user. |
8dcfae475b98
([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents:
23636
diff
changeset
|
190 (global-set-key [language-change] 'ignore) |
8dcfae475b98
([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents:
23636
diff
changeset
|
191 |
13434 | 192 (defvar x-invocation-args) |
193 | |
194 (defvar x-command-line-resources nil) | |
195 | |
196 (defconst x-option-alist | |
197 '(("-bw" . x-handle-numeric-switch) | |
198 ("-d" . x-handle-display) | |
199 ("-display" . x-handle-display) | |
200 ("-name" . x-handle-name-rn-switch) | |
201 ("-rn" . x-handle-name-rn-switch) | |
202 ("-T" . x-handle-switch) | |
203 ("-r" . x-handle-switch) | |
204 ("-rv" . x-handle-switch) | |
205 ("-reverse" . x-handle-switch) | |
206 ("-fn" . x-handle-switch) | |
207 ("-font" . x-handle-switch) | |
208 ("-ib" . x-handle-numeric-switch) | |
209 ("-g" . x-handle-geometry) | |
210 ("-geometry" . x-handle-geometry) | |
211 ("-fg" . x-handle-switch) | |
212 ("-foreground". x-handle-switch) | |
213 ("-bg" . x-handle-switch) | |
214 ("-background". x-handle-switch) | |
215 ("-ms" . x-handle-switch) | |
216 ("-itype" . x-handle-switch) | |
217 ("-i" . x-handle-switch) | |
218 ("-iconic" . x-handle-iconic) | |
219 ("-xrm" . x-handle-xrm-switch) | |
220 ("-cr" . x-handle-switch) | |
221 ("-vb" . x-handle-switch) | |
222 ("-hb" . x-handle-switch) | |
223 ("-bd" . x-handle-switch))) | |
224 | |
225 (defconst x-long-option-alist | |
226 '(("--border-width" . "-bw") | |
227 ("--display" . "-d") | |
228 ("--name" . "-name") | |
229 ("--title" . "-T") | |
230 ("--reverse-video" . "-reverse") | |
231 ("--font" . "-font") | |
232 ("--internal-border" . "-ib") | |
233 ("--geometry" . "-geometry") | |
234 ("--foreground-color" . "-fg") | |
235 ("--background-color" . "-bg") | |
236 ("--mouse-color" . "-ms") | |
237 ("--icon-type" . "-itype") | |
238 ("--iconic" . "-iconic") | |
239 ("--xrm" . "-xrm") | |
240 ("--cursor-color" . "-cr") | |
241 ("--vertical-scroll-bars" . "-vb") | |
242 ("--border-color" . "-bd"))) | |
243 | |
244 (defconst x-switch-definitions | |
245 '(("-name" name) | |
246 ("-T" name) | |
247 ("-r" reverse t) | |
248 ("-rv" reverse t) | |
249 ("-reverse" reverse t) | |
250 ("-fn" font) | |
251 ("-font" font) | |
252 ("-ib" internal-border-width) | |
253 ("-fg" foreground-color) | |
254 ("-foreground" foreground-color) | |
255 ("-bg" background-color) | |
256 ("-background" background-color) | |
257 ("-ms" mouse-color) | |
258 ("-cr" cursor-color) | |
259 ("-itype" icon-type t) | |
260 ("-i" icon-type t) | |
261 ("-vb" vertical-scroll-bars t) | |
262 ("-hb" horizontal-scroll-bars t) | |
263 ("-bd" border-color) | |
264 ("-bw" border-width))) | |
265 | |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
266 |
13434 | 267 (defun x-handle-switch (switch) |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
268 "Handle SWITCH of the form \"-switch value\" or \"-switch\"." |
13434 | 269 (let ((aelt (assoc switch x-switch-definitions))) |
270 (if aelt | |
271 (if (nth 2 aelt) | |
272 (setq default-frame-alist | |
273 (cons (cons (nth 1 aelt) (nth 2 aelt)) | |
274 default-frame-alist)) | |
275 (setq default-frame-alist | |
276 (cons (cons (nth 1 aelt) | |
277 (car x-invocation-args)) | |
278 default-frame-alist) | |
279 x-invocation-args (cdr x-invocation-args)))))) | |
280 | |
281 (defun x-handle-iconic (switch) | |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
282 "Make \"-iconic\" SWITCH apply only to the initial frame." |
13434 | 283 (setq initial-frame-alist |
284 (cons '(visibility . icon) initial-frame-alist))) | |
285 | |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
286 |
13434 | 287 (defun x-handle-numeric-switch (switch) |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
288 "Handle SWITCH of the form \"-switch n\"." |
13434 | 289 (let ((aelt (assoc switch x-switch-definitions))) |
290 (if aelt | |
291 (setq default-frame-alist | |
292 (cons (cons (nth 1 aelt) | |
293 (string-to-int (car x-invocation-args))) | |
294 default-frame-alist) | |
295 x-invocation-args | |
296 (cdr x-invocation-args))))) | |
297 | |
298 (defun x-handle-xrm-switch (switch) | |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
299 "Handle the \"-xrm\" SWITCH." |
13434 | 300 (or (consp x-invocation-args) |
301 (error "%s: missing argument to `%s' option" (invocation-name) switch)) | |
302 (setq x-command-line-resources (car x-invocation-args)) | |
303 (setq x-invocation-args (cdr x-invocation-args))) | |
304 | |
305 (defun x-handle-geometry (switch) | |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
306 "Handle the \"-geometry\" SWITCH." |
13434 | 307 (let ((geo (x-parse-geometry (car x-invocation-args)))) |
308 (setq initial-frame-alist | |
309 (append initial-frame-alist | |
310 (if (or (assq 'left geo) (assq 'top geo)) | |
311 '((user-position . t))) | |
312 (if (or (assq 'height geo) (assq 'width geo)) | |
313 '((user-size . t))) | |
314 geo) | |
315 x-invocation-args (cdr x-invocation-args)))) | |
316 | |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
317 (defun x-handle-name-rn-switch (switch) |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
318 "Handle a \"-name\" or \"-rn\" SWITCH." |
13434 | 319 ;; Handle the -name and -rn options. Set the variable x-resource-name |
320 ;; to the option's operand; if the switch was `-name', set the name of | |
321 ;; the initial frame, too. | |
322 (or (consp x-invocation-args) | |
323 (error "%s: missing argument to `%s' option" (invocation-name) switch)) | |
324 (setq x-resource-name (car x-invocation-args) | |
325 x-invocation-args (cdr x-invocation-args)) | |
326 (if (string= switch "-name") | |
327 (setq initial-frame-alist (cons (cons 'name x-resource-name) | |
328 initial-frame-alist)))) | |
329 | |
330 (defvar x-display-name nil | |
331 "The display name specifying server and frame.") | |
332 | |
333 (defun x-handle-display (switch) | |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
334 "Handle the \"-display\" SWITCH." |
13434 | 335 (setq x-display-name (car x-invocation-args) |
336 x-invocation-args (cdr x-invocation-args))) | |
337 | |
338 (defvar x-invocation-args nil) | |
339 | |
340 (defun x-handle-args (args) | |
341 "Process the X-related command line options in ARGS. | |
342 This is done before the user's startup file is loaded. They are copied to | |
343 x-invocation args from which the X-related things are extracted, first | |
344 the switch (e.g., \"-fg\") in the following code, and possible values | |
345 \(e.g., \"black\") in the option handler code (e.g., x-handle-switch). | |
346 This returns ARGS with the arguments that have been processed removed." | |
347 (setq x-invocation-args args | |
348 args nil) | |
349 (while x-invocation-args | |
350 (let* ((this-switch (car x-invocation-args)) | |
351 (orig-this-switch this-switch) | |
352 completion argval aelt) | |
353 (setq x-invocation-args (cdr x-invocation-args)) | |
354 ;; Check for long options with attached arguments | |
355 ;; and separate out the attached option argument into argval. | |
356 (if (string-match "^--[^=]*=" this-switch) | |
357 (setq argval (substring this-switch (match-end 0)) | |
358 this-switch (substring this-switch 0 (1- (match-end 0))))) | |
359 (setq completion (try-completion this-switch x-long-option-alist)) | |
360 (if (eq completion t) | |
361 ;; Exact match for long option. | |
362 (setq this-switch (cdr (assoc this-switch x-long-option-alist))) | |
363 (if (stringp completion) | |
364 (let ((elt (assoc completion x-long-option-alist))) | |
365 ;; Check for abbreviated long option. | |
366 (or elt | |
367 (error "Option `%s' is ambiguous" this-switch)) | |
368 (setq this-switch (cdr elt))) | |
369 ;; Check for a short option. | |
370 (setq argval nil this-switch orig-this-switch))) | |
371 (setq aelt (assoc this-switch x-option-alist)) | |
372 (if aelt | |
373 (if argval | |
374 (let ((x-invocation-args | |
375 (cons argval x-invocation-args))) | |
376 (funcall (cdr aelt) this-switch)) | |
377 (funcall (cdr aelt) this-switch)) | |
378 (setq args (cons this-switch args))))) | |
379 (setq args (nreverse args))) | |
380 | |
381 | |
382 | |
383 ;; | |
384 ;; Available colors | |
385 ;; | |
386 | |
387 (defvar x-colors '("aquamarine" | |
388 "Aquamarine" | |
389 "medium aquamarine" | |
390 "MediumAquamarine" | |
391 "black" | |
392 "Black" | |
393 "blue" | |
394 "Blue" | |
395 "cadet blue" | |
396 "CadetBlue" | |
397 "cornflower blue" | |
398 "CornflowerBlue" | |
399 "dark slate blue" | |
400 "DarkSlateBlue" | |
401 "light blue" | |
402 "LightBlue" | |
403 "light steel blue" | |
404 "LightSteelBlue" | |
405 "medium blue" | |
406 "MediumBlue" | |
407 "medium slate blue" | |
408 "MediumSlateBlue" | |
409 "midnight blue" | |
410 "MidnightBlue" | |
411 "navy blue" | |
412 "NavyBlue" | |
413 "navy" | |
414 "Navy" | |
415 "sky blue" | |
416 "SkyBlue" | |
417 "slate blue" | |
418 "SlateBlue" | |
419 "steel blue" | |
420 "SteelBlue" | |
421 "coral" | |
422 "Coral" | |
423 "cyan" | |
424 "Cyan" | |
425 "firebrick" | |
426 "Firebrick" | |
427 "brown" | |
428 "Brown" | |
429 "gold" | |
430 "Gold" | |
431 "goldenrod" | |
432 "Goldenrod" | |
433 "green" | |
434 "Green" | |
435 "dark green" | |
436 "DarkGreen" | |
437 "dark olive green" | |
438 "DarkOliveGreen" | |
439 "forest green" | |
440 "ForestGreen" | |
441 "lime green" | |
442 "LimeGreen" | |
443 "medium sea green" | |
444 "MediumSeaGreen" | |
445 "medium spring green" | |
446 "MediumSpringGreen" | |
447 "pale green" | |
448 "PaleGreen" | |
449 "sea green" | |
450 "SeaGreen" | |
451 "spring green" | |
452 "SpringGreen" | |
453 "yellow green" | |
454 "YellowGreen" | |
455 "dark slate grey" | |
456 "DarkSlateGrey" | |
457 "dark slate gray" | |
458 "DarkSlateGray" | |
459 "dim grey" | |
460 "DimGrey" | |
461 "dim gray" | |
462 "DimGray" | |
463 "light grey" | |
464 "LightGrey" | |
465 "light gray" | |
466 "LightGray" | |
467 "gray" | |
468 "grey" | |
469 "Gray" | |
470 "Grey" | |
471 "khaki" | |
472 "Khaki" | |
473 "magenta" | |
474 "Magenta" | |
475 "maroon" | |
476 "Maroon" | |
477 "orange" | |
478 "Orange" | |
479 "orchid" | |
480 "Orchid" | |
481 "dark orchid" | |
482 "DarkOrchid" | |
483 "medium orchid" | |
484 "MediumOrchid" | |
485 "pink" | |
486 "Pink" | |
487 "plum" | |
488 "Plum" | |
489 "red" | |
490 "Red" | |
491 "indian red" | |
492 "IndianRed" | |
493 "medium violet red" | |
494 "MediumVioletRed" | |
495 "orange red" | |
496 "OrangeRed" | |
497 "violet red" | |
498 "VioletRed" | |
499 "salmon" | |
500 "Salmon" | |
501 "sienna" | |
502 "Sienna" | |
503 "tan" | |
504 "Tan" | |
505 "thistle" | |
506 "Thistle" | |
507 "turquoise" | |
508 "Turquoise" | |
509 "dark turquoise" | |
510 "DarkTurquoise" | |
511 "medium turquoise" | |
512 "MediumTurquoise" | |
513 "violet" | |
514 "Violet" | |
515 "blue violet" | |
516 "BlueViolet" | |
517 "wheat" | |
518 "Wheat" | |
519 "white" | |
520 "White" | |
521 "yellow" | |
522 "Yellow" | |
523 "green yellow" | |
524 "GreenYellow") | |
525 "The full list of X colors from the `rgb.text' file.") | |
526 | |
26736
a0674327c167
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26573
diff
changeset
|
527 (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
|
528 "Internal function called by `defined-colors', which see." |
13434 | 529 (or frame (setq frame (selected-frame))) |
16596
0f917c0edc53
(x-defined-colors): Use color names from w32-color-map.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16588
diff
changeset
|
530 (let* ((color-map-colors (mapcar (lambda (clr) (car clr)) w32-color-map)) |
0f917c0edc53
(x-defined-colors): Use color names from w32-color-map.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16588
diff
changeset
|
531 (all-colors (or color-map-colors x-colors)) |
0f917c0edc53
(x-defined-colors): Use color names from w32-color-map.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16588
diff
changeset
|
532 (this-color nil) |
0f917c0edc53
(x-defined-colors): Use color names from w32-color-map.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16588
diff
changeset
|
533 (defined-colors nil)) |
0f917c0edc53
(x-defined-colors): Use color names from w32-color-map.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16588
diff
changeset
|
534 (message "Defining colors...") |
13434 | 535 (while all-colors |
536 (setq this-color (car all-colors) | |
537 all-colors (cdr all-colors)) | |
27101
a5791b2ee668
(xw-defined-colors): Call color-supported-p,
Eli Zaretskii <eliz@gnu.org>
parents:
26736
diff
changeset
|
538 (and (color-supported-p this-color frame t) |
13434 | 539 (setq defined-colors (cons this-color defined-colors)))) |
540 defined-colors)) | |
541 | |
19691
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
542 |
13434 | 543 ;;;; Function keys |
544 | |
19691
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
545 ;;; make f10 activate the real menubar rather than the mini-buffer menu |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
546 ;;; navigation feature. |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
547 (global-set-key [f10] (lambda () |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
548 (interactive) (w32-send-sys-command ?\xf100))) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
549 |
13434 | 550 (defun iconify-or-deiconify-frame () |
551 "Iconify the selected frame, or deiconify if it's currently an icon." | |
552 (interactive) | |
553 (if (eq (cdr (assq 'visibility (frame-parameters))) t) | |
554 (iconify-frame) | |
555 (make-frame-visible))) | |
556 | |
557 (substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame | |
558 global-map) | |
559 | |
560 | |
561 ;;; Do the actual Windows setup here; the above code just defines | |
562 ;;; functions and variables that we use now. | |
563 | |
564 (setq command-line-args (x-handle-args command-line-args)) | |
565 | |
566 ;;; Make sure we have a valid resource name. | |
567 (or (stringp x-resource-name) | |
568 (let (i) | |
569 (setq x-resource-name (invocation-name)) | |
570 | |
571 ;; Change any . or * characters in x-resource-name to hyphens, | |
572 ;; so as not to choke when we use it in X resource queries. | |
573 (while (setq i (string-match "[.*]" x-resource-name)) | |
574 (aset x-resource-name i ?-)))) | |
575 | |
576 ;; For the benefit of older Emacses (19.27 and earlier) that are sharing | |
577 ;; the same lisp directory, don't pass the third argument unless we seem | |
578 ;; to have the multi-display support. | |
579 (if (fboundp 'x-close-connection) | |
580 (x-open-connection "" | |
581 x-command-line-resources | |
582 ;; Exit Emacs with fatal error if this fails. | |
583 t) | |
584 (x-open-connection "" | |
585 x-command-line-resources)) | |
586 | |
587 (setq frame-creation-function 'x-create-frame-with-faces) | |
588 | |
589 (setq x-cut-buffer-max (min (- (/ (x-server-max-request-size) 2) 100) | |
590 x-cut-buffer-max)) | |
591 | |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
592 ;; W32 expects the menu bar cut and paste commands to use the clipboard. |
13434 | 593 ;; This has ,? to match both on Sunos and on Solaris. |
594 (menu-bar-enable-clipboard) | |
595 | |
23636
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
596 ;; 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
|
597 ;; we define our own standard fontset here. |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
598 (defvar w32-standard-fontset-spec |
24212
36652d90b38f
(w32-standard-fontset-spec): Remove wildcard
Geoff Voelker <voelker@cs.washington.edu>
parents:
24142
diff
changeset
|
599 "-*-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
|
600 "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
|
601 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
|
602 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
|
603 \"Multilanguage Support\". |
23636
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
604 |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
605 See the documentation of `create-fontset-from-fontset-spec for the format.") |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
606 |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
607 (if (fboundp 'new-fontset) |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
608 (progn |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
609 ;; Create the standard fontset. |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
610 (create-fontset-from-fontset-spec w32-standard-fontset-spec t) |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
611 ;; Create fontset specified in X resources "Fontset-N" (N is 0, 1,...). |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
612 (create-fontset-from-x-resource) |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
613 ;; Try to create a fontset from a font specification which comes |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
614 ;; from initial-frame-alist, default-frame-alist, or X resource. |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
615 ;; A font specification in command line argument (i.e. -fn XXXX) |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
616 ;; should be already in default-frame-alist as a `font' |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
617 ;; parameter. However, any font specifications in site-start |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
618 ;; library, user's init file (.emacs), and default.el are not |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
619 ;; yet handled here. |
23636
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
620 |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
621 (let ((font (or (cdr (assq 'font initial-frame-alist)) |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
622 (cdr (assq 'font default-frame-alist)) |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
623 (x-get-resource "font" "Font"))) |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
624 xlfd-fields resolved-name) |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
625 (if (and font |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
626 (not (query-fontset font)) |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
627 (setq resolved-name (x-resolve-font-name font)) |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
628 (setq xlfd-fields (x-decompose-font-name font))) |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
629 (if (string= "fontset" |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
630 (aref xlfd-fields xlfd-regexp-registry-subnum)) |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
631 (new-fontset font |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
632 (x-complement-fontset-spec xlfd-fields nil)) |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
633 ;; Create a fontset from FONT. The fontset name is |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
634 ;; generated from FONT. |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
635 (create-fontset-from-ascii-font font |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
636 resolved-name "startup")))))) |
23636
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
637 |
13434 | 638 ;; Apply a geometry resource to the initial frame. Put it at the end |
639 ;; of the alist, so that anything specified on the command line takes | |
640 ;; precedence. | |
641 (let* ((res-geometry (x-get-resource "geometry" "Geometry")) | |
642 parsed) | |
643 (if res-geometry | |
644 (progn | |
645 (setq parsed (x-parse-geometry res-geometry)) | |
646 ;; If the resource specifies a position, | |
647 ;; call the position and size "user-specified". | |
648 (if (or (assq 'top parsed) (assq 'left parsed)) | |
649 (setq parsed (cons '(user-position . t) | |
650 (cons '(user-size . t) parsed)))) | |
651 ;; All geometry parms apply to the initial frame. | |
652 (setq initial-frame-alist (append initial-frame-alist parsed)) | |
653 ;; The size parms apply to all frames. | |
654 (if (assq 'height parsed) | |
655 (setq default-frame-alist | |
656 (cons (cons 'height (cdr (assq 'height parsed))) | |
657 default-frame-alist))) | |
658 (if (assq 'width parsed) | |
659 (setq default-frame-alist | |
660 (cons (cons 'width (cdr (assq 'width parsed))) | |
661 default-frame-alist)))))) | |
662 | |
663 ;; Check the reverseVideo resource. | |
664 (let ((case-fold-search t)) | |
665 (let ((rv (x-get-resource "reverseVideo" "ReverseVideo"))) | |
666 (if (and rv | |
667 (string-match "^\\(true\\|yes\\|on\\)$" rv)) | |
668 (setq default-frame-alist | |
669 (cons '(reverse . t) default-frame-alist))))) | |
670 | |
671 (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
|
672 "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
|
673 (error "Suspending an Emacs running under W32 makes no sense")) |
13434 | 674 (add-hook 'suspend-hook 'x-win-suspend-error) |
675 | |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
676 ;;; Turn off window-splitting optimization; w32 is usually fast enough |
13434 | 677 ;;; that this is only annoying. |
678 (setq split-window-keep-point t) | |
679 | |
680 ;; Don't show the frame name; that's redundant. | |
19167
337f5643498e
Set mode-line-frame-identification
Geoff Voelker <voelker@cs.washington.edu>
parents:
16889
diff
changeset
|
681 (setq-default mode-line-frame-identification " ") |
13434 | 682 |
683 ;;; Set to a system sound if you want a fancy bell. | |
684 (set-message-beep 'ok) | |
685 | |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
686 ;; Remap some functions to call w32 common dialogs |
13434 | 687 |
688 (defun internal-face-interactive (what &optional bool) | |
689 (let* ((fn (intern (concat "face-" what))) | |
27832
866f7a6b82b3
(internal-face-interactive): Update prompt for new read-face-name.
Dave Love <fx@gnu.org>
parents:
27623
diff
changeset
|
690 (prompt (concat "Set " what " of face ")) |
866f7a6b82b3
(internal-face-interactive): Update prompt for new read-face-name.
Dave Love <fx@gnu.org>
parents:
27623
diff
changeset
|
691 (face (read-face-name prompt)) |
13434 | 692 (default (if (fboundp fn) |
693 (or (funcall fn face (selected-frame)) | |
694 (funcall fn 'default (selected-frame))))) | |
695 (fn-win (intern (concat (symbol-name window-system) "-select-" what))) | |
22539
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
696 value) |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
697 (setq value |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
698 (cond ((fboundp fn-win) |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
699 (funcall fn-win)) |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
700 ((eq bool 'color) |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
701 (completing-read (concat prompt " " (symbol-name face) " to: ") |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
702 (mapcar (function (lambda (color) |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
703 (cons color color))) |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
704 x-colors) |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
705 nil nil nil nil default)) |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
706 (bool |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
707 (y-or-n-p (concat "Should face " (symbol-name face) |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
708 " be " bool "? "))) |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
709 (t |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
710 (read-string (concat prompt " " (symbol-name face) " to: ") |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
711 nil nil default)))) |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
712 (list face (if (equal value "") nil value)))) |
13434 | 713 |
16889
8de32e992e4d
Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16596
diff
changeset
|
714 ;; Redefine the font selection to use the standard W32 dialog |
23560
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
715 (defvar w32-use-w32-font-dialog t |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
716 "*Use the standard font dialog if 't'. |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
717 Otherwise pop up a menu of some standard fonts like X does - including |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
718 fontsets.") |
23560
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
719 |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
720 (defvar w32-fixed-font-alist |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
721 '("Font menu" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
722 ("Misc" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
723 ;; For these, we specify the pixel height and width. |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
724 ("fixed" "Fixedsys") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
725 ("") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
726 ("Terminal 5x4" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
727 "-*-Terminal-normal-r-*-*-*-45-*-*-c-40-*-oem") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
728 ("Terminal 6x8" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
729 "-*-Terminal-normal-r-*-*-*-60-*-*-c-80-*-oem") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
730 ("Terminal 9x5" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
731 "-*-Terminal-normal-r-*-*-*-90-*-*-c-50-*-oem") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
732 ("Terminal 9x7" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
733 "-*-Terminal-normal-r-*-*-*-90-*-*-c-70-*-oem") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
734 ("Terminal 9x8" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
735 "-*-Terminal-normal-r-*-*-*-90-*-*-c-80-*-oem") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
736 ("Terminal 12x12" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
737 "-*-Terminal-normal-r-*-*-*-120-*-*-c-120-*-oem") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
738 ("Terminal 14x10" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
739 "-*-Terminal-normal-r-*-*-*-135-*-*-c-100-*-oem") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
740 ("Terminal 6x6 Bold" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
741 "-*-Terminal-bold-r-*-*-*-60-*-*-c-60-*-oem") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
742 ("") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
743 ("Lucida Sans Typewriter.8" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
744 "-*-Lucida Sans Typewriter-normal-r-*-*-11-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
745 ("Lucida Sans Typewriter.9" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
746 "-*-Lucida Sans Typewriter-normal-r-*-*-12-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
747 ("Lucida Sans Typewriter.10" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
748 "-*-Lucida Sans Typewriter-normal-r-*-*-13-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
749 ("Lucida Sans Typewriter.11" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
750 "-*-Lucida Sans Typewriter-normal-r-*-*-15-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
751 ("Lucida Sans Typewriter.12" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
752 "-*-Lucida Sans Typewriter-normal-r-*-*-16-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
753 ("Lucida Sans Typewriter.8 Bold" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
754 "-*-Lucida Sans Typewriter-semibold-r-*-*-11-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
755 ("Lucida Sans Typewriter.9 Bold" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
756 "-*-Lucida Sans Typewriter-semibold-r-*-*-12-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
757 ("Lucida Sans Typewriter.10 Bold" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
758 "-*-Lucida Sans Typewriter-semibold-r-*-*-13-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
759 ("Lucida Sans Typewriter.11 Bold" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
760 "-*-Lucida Sans Typewriter-semibold-r-*-*-15-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
761 ("Lucida Sans Typewriter.12 Bold" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
762 "-*-Lucida Sans Typewriter-semibold-r-*-*-16-*-*-*-c-*-iso8859-1")) |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
763 ("Courier" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
764 ("Courier 10x8" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
765 "-*-Courier-*normal-r-*-*-*-97-*-*-c-80-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
766 ("Courier 12x9" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
767 "-*-Courier-*normal-r-*-*-*-120-*-*-c-90-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
768 ("Courier 15x12" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
769 "-*-Courier-*normal-r-*-*-*-150-*-*-c-120-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
770 ;; For these, we specify the point height. |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
771 ("") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
772 ("8" "-*-Courier New-normal-r-*-*-11-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
773 ("9" "-*-Courier New-normal-r-*-*-12-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
774 ("10" "-*-Courier New-normal-r-*-*-13-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
775 ("11" "-*-Courier New-normal-r-*-*-15-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
776 ("12" "-*-Courier New-normal-r-*-*-16-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
777 ("8 bold" "-*-Courier New-bold-r-*-*-11-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
778 ("9 bold" "-*-Courier New-bold-r-*-*-12-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
779 ("10 bold" "-*-Courier New-bold-r-*-*-13-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
780 ("11 bold" "-*-Courier New-bold-r-*-*-15-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
781 ("12 bold" "-*-Courier New-bold-r-*-*-16-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
782 ("8 italic" "-*-Courier New-normal-i-*-*-11-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
783 ("9 italic" "-*-Courier New-normal-i-*-*-12-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
784 ("10 italic" "-*-Courier New-normal-i-*-*-13-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
785 ("11 italic" "-*-Courier New-normal-i-*-*-15-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
786 ("12 italic" "-*-Courier New-normal-i-*-*-16-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
787 ("8 bold italic" "-*-Courier New-bold-i-*-*-11-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
788 ("9 bold italic" "-*-Courier New-bold-i-*-*-12-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
789 ("10 bold italic" "-*-Courier New-bold-i-*-*-13-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
790 ("11 bold italic" "-*-Courier New-bold-i-*-*-15-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
791 ("12 bold italic" "-*-Courier New-bold-i-*-*-16-*-*-*-c-*-iso8859-1") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
792 )) |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
793 "Fonts suitable for use in Emacs. |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
794 Initially this is a list of some fixed width fonts that most people |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
795 will have like Terminal and Courier. These fonts are used in the font |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
796 menu if the variable `w32-use-w32-font-dialog' is nil.") |
13434 | 797 |
24686
f2ecc3b6a45f
Change the x-charset-registry property for the
Andrew Innes <andrewi@gnu.org>
parents:
24683
diff
changeset
|
798 ;;; Enable Japanese fonts on Windows to be used by default. |
30236
c6e051bf5f2e
Make FONTNAME arg to set-fontset-font a cons.
Jason Rumney <jasonr@gnu.org>
parents:
29322
diff
changeset
|
799 (set-fontset-font t (make-char 'katakana-jisx0201) '("*" . "JISX0208-SJIS")) |
c6e051bf5f2e
Make FONTNAME arg to set-fontset-font a cons.
Jason Rumney <jasonr@gnu.org>
parents:
29322
diff
changeset
|
800 (set-fontset-font t (make-char 'latin-jisx0201) '("*" . "JISX0208-SJIS")) |
c6e051bf5f2e
Make FONTNAME arg to set-fontset-font a cons.
Jason Rumney <jasonr@gnu.org>
parents:
29322
diff
changeset
|
801 (set-fontset-font t (make-char 'japanese-jisx0208) '("*" . "JISX0208-SJIS")) |
c6e051bf5f2e
Make FONTNAME arg to set-fontset-font a cons.
Jason Rumney <jasonr@gnu.org>
parents:
29322
diff
changeset
|
802 (set-fontset-font t (make-char 'japanese-jisx0208-1978) '("*" . "JISX0208-SJIS")) |
24686
f2ecc3b6a45f
Change the x-charset-registry property for the
Andrew Innes <andrewi@gnu.org>
parents:
24683
diff
changeset
|
803 |
13434 | 804 (defun mouse-set-font (&rest fonts) |
29322
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
805 "Select a font. |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
806 If `w32-use-w32-font-dialog' is non-nil (the default), use the Windows |
16e1a87707b5
Doc changes to reduce diffs with x-win.el.
Jason Rumney <jasonr@gnu.org>
parents:
27887
diff
changeset
|
807 font dialog to get the matching FONTS. Otherwise use a pop-up menu |
35770 | 808 \(like Emacs on other platforms) initialized with the fonts in |
27887
a9f19a6bfb69
(mouse-set-font): Do not build fontset from chosen font.
Jason Rumney <jasonr@gnu.org>
parents:
27832
diff
changeset
|
809 `w32-fixed-font-alist'." |
23560
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
810 (interactive |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
811 (if w32-use-w32-font-dialog |
24964
22d526660026
(mouse-set-font): If user uses w32 dialog but
Karl Heuer <kwzh@gnu.org>
parents:
24686
diff
changeset
|
812 (let ((chosen-font (w32-select-font))) |
22d526660026
(mouse-set-font): If user uses w32 dialog but
Karl Heuer <kwzh@gnu.org>
parents:
24686
diff
changeset
|
813 (and chosen-font (list chosen-font))) |
23560
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
814 (x-popup-menu |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
815 last-nonmenu-event |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
816 ;; Append list of fontsets currently defined. |
23636
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
817 (if (fboundp 'new-fontset) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
818 (append w32-fixed-font-alist (list (generate-fontset-menu))))))) |
23560
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
819 (if fonts |
27887
a9f19a6bfb69
(mouse-set-font): Do not build fontset from chosen font.
Jason Rumney <jasonr@gnu.org>
parents:
27832
diff
changeset
|
820 (let (font) |
23560
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
821 (while fonts |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
822 (condition-case nil |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
823 (progn |
24212
36652d90b38f
(w32-standard-fontset-spec): Remove wildcard
Geoff Voelker <voelker@cs.washington.edu>
parents:
24142
diff
changeset
|
824 (setq font (car fonts)) |
27887
a9f19a6bfb69
(mouse-set-font): Do not build fontset from chosen font.
Jason Rumney <jasonr@gnu.org>
parents:
27832
diff
changeset
|
825 (set-default-font font) |
24212
36652d90b38f
(w32-standard-fontset-spec): Remove wildcard
Geoff Voelker <voelker@cs.washington.edu>
parents:
24142
diff
changeset
|
826 (setq fonts nil)) |
36652d90b38f
(w32-standard-fontset-spec): Remove wildcard
Geoff Voelker <voelker@cs.washington.edu>
parents:
24142
diff
changeset
|
827 (error (setq fonts (cdr fonts))))) |
23560
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
828 (if (null font) |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
829 (error "Font not found"))))) |
13434 | 830 |
16889
8de32e992e4d
Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16596
diff
changeset
|
831 ;;; w32-win.el ends here |