Mercurial > emacs
annotate lisp/term/w32-win.el @ 23762:f69129948f65
(read_process_output): Call signal_after_change.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 25 Nov 1998 01:26:56 +0000 |
parents | 8dcfae475b98 |
children | 598274a2398f |
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 |
15136
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
82 ;; 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
|
83 ;; 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
|
84 ;; scroll bar routines. |
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
85 |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
86 (defun w32-handle-scroll-bar-event (event) |
16889
8de32e992e4d
Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16596
diff
changeset
|
87 "Handle W32 scroll bar events 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
|
88 (interactive "e") |
15265
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
89 (let ((old-window (selected-window))) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
90 (unwind-protect |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
91 (let* ((position (event-start event)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
92 (window (nth 0 position)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
93 (portion-whole (nth 2 position)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
94 (bar-part (nth 4 position))) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
95 (save-excursion |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
96 (select-window window) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
97 (cond |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
98 ((eq bar-part 'up) |
19691
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
99 (goto-char (window-start window)) |
15265
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
100 (scroll-down 1)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
101 ((eq bar-part 'above-handle) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
102 (scroll-down)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
103 ((eq bar-part 'handle) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
104 (scroll-bar-maybe-set-window-start event)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
105 ((eq bar-part 'below-handle) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
106 (scroll-up)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
107 ((eq bar-part 'down) |
19691
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
108 (goto-char (window-start window)) |
15265
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
109 (scroll-up 1)) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
110 ))) |
658224992372
(win32-handle-scroll-bar-event): Restore
Karl Heuer <kwzh@gnu.org>
parents:
15217
diff
changeset
|
111 (select-window old-window)))) |
15136
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
112 |
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
113 ;; 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
|
114 ;(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
|
115 |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
116 (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
|
117 |
6a1b4fcbb216
(win32-handle-scroll-bar-event): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15048
diff
changeset
|
118 ;; (scroll-bar-mode nil) |
13831
2b90a48bb3db
Disable scrollbars until fully functional.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13434
diff
changeset
|
119 |
19691
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
120 (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
|
121 "*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
|
122 |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
123 (defun mouse-wheel-scroll-line (event) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
124 "Scroll the current buffer by `mouse-wheel-scroll-amount'." |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
125 (interactive "e") |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
126 (condition-case nil |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
127 (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
|
128 (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
|
129 (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
|
130 (error nil))) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
131 |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
132 ;; 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
|
133 ;; commands won't interact |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
134 (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
|
135 |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
136 (defun mouse-wheel-scroll-screen (event) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
137 "Scroll the current buffer by `mouse-wheel-scroll-amount'." |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
138 (interactive "e") |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
139 (condition-case nil |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
140 (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
|
141 (scroll-up) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
142 (scroll-down)) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
143 (error nil))) |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
144 |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
145 ;; Bind the mouse-wheel event: |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
146 (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
|
147 (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
|
148 |
21883
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
149 (defun w32-drag-n-drop-debug (event) |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
150 "Print the drag-n-drop event in a readable form." |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
151 (interactive "e") |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
152 (princ event)) |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
153 |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
154 (defun w32-drag-n-drop (event) |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
155 "Edit the files listed in 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
|
156 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
|
157 (interactive "e") |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
158 (mapcar 'find-file (car (cdr (cdr event)))) |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
159 (raise-frame)) |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
160 |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
161 (defun w32-drag-n-drop-other-frame (event) |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
162 "Edit the files listed in the drag-n-drop event, in other frames. |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
163 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
|
164 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
|
165 (interactive "e") |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
166 (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
|
167 |
93c99b3a57f1
(w32-drag-n-drop-debug, w32-drag-n-drop)
Richard M. Stallman <rms@gnu.org>
parents:
19691
diff
changeset
|
168 ;; 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
|
169 (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
|
170 (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
|
171 |
23675
8dcfae475b98
([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents:
23636
diff
changeset
|
172 ;; Keyboard layout/language change events |
8dcfae475b98
([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents:
23636
diff
changeset
|
173 ;; 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
|
174 ;; 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
|
175 ;; new layout/language selected by the user. |
8dcfae475b98
([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents:
23636
diff
changeset
|
176 (global-set-key [language-change] 'ignore) |
8dcfae475b98
([language-change]): For now ignore
Geoff Voelker <voelker@cs.washington.edu>
parents:
23636
diff
changeset
|
177 |
13434 | 178 (defvar x-invocation-args) |
179 | |
180 (defvar x-command-line-resources nil) | |
181 | |
182 (defconst x-option-alist | |
183 '(("-bw" . x-handle-numeric-switch) | |
184 ("-d" . x-handle-display) | |
185 ("-display" . x-handle-display) | |
186 ("-name" . x-handle-name-rn-switch) | |
187 ("-rn" . x-handle-name-rn-switch) | |
188 ("-T" . x-handle-switch) | |
189 ("-r" . x-handle-switch) | |
190 ("-rv" . x-handle-switch) | |
191 ("-reverse" . x-handle-switch) | |
192 ("-fn" . x-handle-switch) | |
193 ("-font" . x-handle-switch) | |
194 ("-ib" . x-handle-numeric-switch) | |
195 ("-g" . x-handle-geometry) | |
196 ("-geometry" . x-handle-geometry) | |
197 ("-fg" . x-handle-switch) | |
198 ("-foreground". x-handle-switch) | |
199 ("-bg" . x-handle-switch) | |
200 ("-background". x-handle-switch) | |
201 ("-ms" . x-handle-switch) | |
202 ("-itype" . x-handle-switch) | |
203 ("-i" . x-handle-switch) | |
204 ("-iconic" . x-handle-iconic) | |
205 ("-xrm" . x-handle-xrm-switch) | |
206 ("-cr" . x-handle-switch) | |
207 ("-vb" . x-handle-switch) | |
208 ("-hb" . x-handle-switch) | |
209 ("-bd" . x-handle-switch))) | |
210 | |
211 (defconst x-long-option-alist | |
212 '(("--border-width" . "-bw") | |
213 ("--display" . "-d") | |
214 ("--name" . "-name") | |
215 ("--title" . "-T") | |
216 ("--reverse-video" . "-reverse") | |
217 ("--font" . "-font") | |
218 ("--internal-border" . "-ib") | |
219 ("--geometry" . "-geometry") | |
220 ("--foreground-color" . "-fg") | |
221 ("--background-color" . "-bg") | |
222 ("--mouse-color" . "-ms") | |
223 ("--icon-type" . "-itype") | |
224 ("--iconic" . "-iconic") | |
225 ("--xrm" . "-xrm") | |
226 ("--cursor-color" . "-cr") | |
227 ("--vertical-scroll-bars" . "-vb") | |
228 ("--border-color" . "-bd"))) | |
229 | |
230 (defconst x-switch-definitions | |
231 '(("-name" name) | |
232 ("-T" name) | |
233 ("-r" reverse t) | |
234 ("-rv" reverse t) | |
235 ("-reverse" reverse t) | |
236 ("-fn" font) | |
237 ("-font" font) | |
238 ("-ib" internal-border-width) | |
239 ("-fg" foreground-color) | |
240 ("-foreground" foreground-color) | |
241 ("-bg" background-color) | |
242 ("-background" background-color) | |
243 ("-ms" mouse-color) | |
244 ("-cr" cursor-color) | |
245 ("-itype" icon-type t) | |
246 ("-i" icon-type t) | |
247 ("-vb" vertical-scroll-bars t) | |
248 ("-hb" horizontal-scroll-bars t) | |
249 ("-bd" border-color) | |
250 ("-bw" border-width))) | |
251 | |
252 ;; Handler for switches of the form "-switch value" or "-switch". | |
253 (defun x-handle-switch (switch) | |
254 (let ((aelt (assoc switch x-switch-definitions))) | |
255 (if aelt | |
256 (if (nth 2 aelt) | |
257 (setq default-frame-alist | |
258 (cons (cons (nth 1 aelt) (nth 2 aelt)) | |
259 default-frame-alist)) | |
260 (setq default-frame-alist | |
261 (cons (cons (nth 1 aelt) | |
262 (car x-invocation-args)) | |
263 default-frame-alist) | |
264 x-invocation-args (cdr x-invocation-args)))))) | |
265 | |
266 ;; Make -iconic apply only to the initial frame! | |
267 (defun x-handle-iconic (switch) | |
268 (setq initial-frame-alist | |
269 (cons '(visibility . icon) initial-frame-alist))) | |
270 | |
271 ;; Handler for switches of the form "-switch n" | |
272 (defun x-handle-numeric-switch (switch) | |
273 (let ((aelt (assoc switch x-switch-definitions))) | |
274 (if aelt | |
275 (setq default-frame-alist | |
276 (cons (cons (nth 1 aelt) | |
277 (string-to-int (car x-invocation-args))) | |
278 default-frame-alist) | |
279 x-invocation-args | |
280 (cdr x-invocation-args))))) | |
281 | |
282 ;; Handle the -xrm option. | |
283 (defun x-handle-xrm-switch (switch) | |
284 (or (consp x-invocation-args) | |
285 (error "%s: missing argument to `%s' option" (invocation-name) switch)) | |
286 (setq x-command-line-resources (car x-invocation-args)) | |
287 (setq x-invocation-args (cdr x-invocation-args))) | |
288 | |
289 ;; Handle the geometry option | |
290 (defun x-handle-geometry (switch) | |
291 (let ((geo (x-parse-geometry (car x-invocation-args)))) | |
292 (setq initial-frame-alist | |
293 (append initial-frame-alist | |
294 (if (or (assq 'left geo) (assq 'top geo)) | |
295 '((user-position . t))) | |
296 (if (or (assq 'height geo) (assq 'width geo)) | |
297 '((user-size . t))) | |
298 geo) | |
299 x-invocation-args (cdr x-invocation-args)))) | |
300 | |
301 ;; Handle the -name and -rn options. Set the variable x-resource-name | |
302 ;; to the option's operand; if the switch was `-name', set the name of | |
303 ;; the initial frame, too. | |
304 (defun x-handle-name-rn-switch (switch) | |
305 (or (consp x-invocation-args) | |
306 (error "%s: missing argument to `%s' option" (invocation-name) switch)) | |
307 (setq x-resource-name (car x-invocation-args) | |
308 x-invocation-args (cdr x-invocation-args)) | |
309 (if (string= switch "-name") | |
310 (setq initial-frame-alist (cons (cons 'name x-resource-name) | |
311 initial-frame-alist)))) | |
312 | |
313 (defvar x-display-name nil | |
314 "The display name specifying server and frame.") | |
315 | |
316 (defun x-handle-display (switch) | |
317 (setq x-display-name (car x-invocation-args) | |
318 x-invocation-args (cdr x-invocation-args))) | |
319 | |
320 (defvar x-invocation-args nil) | |
321 | |
322 (defun x-handle-args (args) | |
323 "Process the X-related command line options in ARGS. | |
324 This is done before the user's startup file is loaded. They are copied to | |
325 x-invocation args from which the X-related things are extracted, first | |
326 the switch (e.g., \"-fg\") in the following code, and possible values | |
327 \(e.g., \"black\") in the option handler code (e.g., x-handle-switch). | |
328 This returns ARGS with the arguments that have been processed removed." | |
329 (message "%s" args) | |
330 (setq x-invocation-args args | |
331 args nil) | |
332 (while x-invocation-args | |
333 (let* ((this-switch (car x-invocation-args)) | |
334 (orig-this-switch this-switch) | |
335 completion argval aelt) | |
336 (setq x-invocation-args (cdr x-invocation-args)) | |
337 ;; Check for long options with attached arguments | |
338 ;; and separate out the attached option argument into argval. | |
339 (if (string-match "^--[^=]*=" this-switch) | |
340 (setq argval (substring this-switch (match-end 0)) | |
341 this-switch (substring this-switch 0 (1- (match-end 0))))) | |
342 (setq completion (try-completion this-switch x-long-option-alist)) | |
343 (if (eq completion t) | |
344 ;; Exact match for long option. | |
345 (setq this-switch (cdr (assoc this-switch x-long-option-alist))) | |
346 (if (stringp completion) | |
347 (let ((elt (assoc completion x-long-option-alist))) | |
348 ;; Check for abbreviated long option. | |
349 (or elt | |
350 (error "Option `%s' is ambiguous" this-switch)) | |
351 (setq this-switch (cdr elt))) | |
352 ;; Check for a short option. | |
353 (setq argval nil this-switch orig-this-switch))) | |
354 (setq aelt (assoc this-switch x-option-alist)) | |
355 (if aelt | |
356 (if argval | |
357 (let ((x-invocation-args | |
358 (cons argval x-invocation-args))) | |
359 (funcall (cdr aelt) this-switch)) | |
360 (funcall (cdr aelt) this-switch)) | |
361 (setq args (cons this-switch args))))) | |
362 (setq args (nreverse args))) | |
363 | |
364 | |
365 | |
366 ;; | |
367 ;; Available colors | |
368 ;; | |
369 | |
370 (defvar x-colors '("aquamarine" | |
371 "Aquamarine" | |
372 "medium aquamarine" | |
373 "MediumAquamarine" | |
374 "black" | |
375 "Black" | |
376 "blue" | |
377 "Blue" | |
378 "cadet blue" | |
379 "CadetBlue" | |
380 "cornflower blue" | |
381 "CornflowerBlue" | |
382 "dark slate blue" | |
383 "DarkSlateBlue" | |
384 "light blue" | |
385 "LightBlue" | |
386 "light steel blue" | |
387 "LightSteelBlue" | |
388 "medium blue" | |
389 "MediumBlue" | |
390 "medium slate blue" | |
391 "MediumSlateBlue" | |
392 "midnight blue" | |
393 "MidnightBlue" | |
394 "navy blue" | |
395 "NavyBlue" | |
396 "navy" | |
397 "Navy" | |
398 "sky blue" | |
399 "SkyBlue" | |
400 "slate blue" | |
401 "SlateBlue" | |
402 "steel blue" | |
403 "SteelBlue" | |
404 "coral" | |
405 "Coral" | |
406 "cyan" | |
407 "Cyan" | |
408 "firebrick" | |
409 "Firebrick" | |
410 "brown" | |
411 "Brown" | |
412 "gold" | |
413 "Gold" | |
414 "goldenrod" | |
415 "Goldenrod" | |
416 "green" | |
417 "Green" | |
418 "dark green" | |
419 "DarkGreen" | |
420 "dark olive green" | |
421 "DarkOliveGreen" | |
422 "forest green" | |
423 "ForestGreen" | |
424 "lime green" | |
425 "LimeGreen" | |
426 "medium sea green" | |
427 "MediumSeaGreen" | |
428 "medium spring green" | |
429 "MediumSpringGreen" | |
430 "pale green" | |
431 "PaleGreen" | |
432 "sea green" | |
433 "SeaGreen" | |
434 "spring green" | |
435 "SpringGreen" | |
436 "yellow green" | |
437 "YellowGreen" | |
438 "dark slate grey" | |
439 "DarkSlateGrey" | |
440 "dark slate gray" | |
441 "DarkSlateGray" | |
442 "dim grey" | |
443 "DimGrey" | |
444 "dim gray" | |
445 "DimGray" | |
446 "light grey" | |
447 "LightGrey" | |
448 "light gray" | |
449 "LightGray" | |
450 "gray" | |
451 "grey" | |
452 "Gray" | |
453 "Grey" | |
454 "khaki" | |
455 "Khaki" | |
456 "magenta" | |
457 "Magenta" | |
458 "maroon" | |
459 "Maroon" | |
460 "orange" | |
461 "Orange" | |
462 "orchid" | |
463 "Orchid" | |
464 "dark orchid" | |
465 "DarkOrchid" | |
466 "medium orchid" | |
467 "MediumOrchid" | |
468 "pink" | |
469 "Pink" | |
470 "plum" | |
471 "Plum" | |
472 "red" | |
473 "Red" | |
474 "indian red" | |
475 "IndianRed" | |
476 "medium violet red" | |
477 "MediumVioletRed" | |
478 "orange red" | |
479 "OrangeRed" | |
480 "violet red" | |
481 "VioletRed" | |
482 "salmon" | |
483 "Salmon" | |
484 "sienna" | |
485 "Sienna" | |
486 "tan" | |
487 "Tan" | |
488 "thistle" | |
489 "Thistle" | |
490 "turquoise" | |
491 "Turquoise" | |
492 "dark turquoise" | |
493 "DarkTurquoise" | |
494 "medium turquoise" | |
495 "MediumTurquoise" | |
496 "violet" | |
497 "Violet" | |
498 "blue violet" | |
499 "BlueViolet" | |
500 "wheat" | |
501 "Wheat" | |
502 "white" | |
503 "White" | |
504 "yellow" | |
505 "Yellow" | |
506 "green yellow" | |
507 "GreenYellow") | |
508 "The full list of X colors from the `rgb.text' file.") | |
509 | |
510 (defun x-defined-colors (&optional frame) | |
511 "Return a list of colors supported for a particular frame. | |
512 The argument FRAME specifies which frame to try. | |
513 The value may be different for frames on different X displays." | |
514 (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
|
515 (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
|
516 (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
|
517 (this-color nil) |
0f917c0edc53
(x-defined-colors): Use color names from w32-color-map.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16588
diff
changeset
|
518 (defined-colors nil)) |
0f917c0edc53
(x-defined-colors): Use color names from w32-color-map.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16588
diff
changeset
|
519 (message "Defining colors...") |
13434 | 520 (while all-colors |
521 (setq this-color (car all-colors) | |
522 all-colors (cdr all-colors)) | |
523 (and (face-color-supported-p frame this-color t) | |
524 (setq defined-colors (cons this-color defined-colors)))) | |
525 defined-colors)) | |
526 | |
19691
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
527 |
13434 | 528 ;;;; Function keys |
529 | |
19691
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
530 ;;; 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
|
531 ;;; navigation feature. |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
532 (global-set-key [f10] (lambda () |
a96c6fa10e92
(w32-handle-scroll-bar-event): On up and
Geoff Voelker <voelker@cs.washington.edu>
parents:
19167
diff
changeset
|
533 (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
|
534 |
13434 | 535 (defun iconify-or-deiconify-frame () |
536 "Iconify the selected frame, or deiconify if it's currently an icon." | |
537 (interactive) | |
538 (if (eq (cdr (assq 'visibility (frame-parameters))) t) | |
539 (iconify-frame) | |
540 (make-frame-visible))) | |
541 | |
542 (substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame | |
543 global-map) | |
544 | |
545 | |
546 ;;;; Selections and cut buffers | |
547 | |
548 ;;; We keep track of the last text selected here, so we can check the | |
549 ;;; current selection against it, and avoid passing back our own text | |
550 ;;; from x-cut-buffer-or-selection-value. | |
551 (defvar x-last-selected-text nil) | |
552 | |
553 ;;; It is said that overlarge strings are slow to put into the cut buffer. | |
554 ;;; Note this value is overridden below. | |
555 (defvar x-cut-buffer-max 20000 | |
556 "Max number of characters to put in the cut buffer.") | |
557 | |
558 (defvar x-select-enable-clipboard t | |
559 "Non-nil means cutting and pasting uses the clipboard. | |
560 This is in addition to the primary selection.") | |
561 | |
562 (defun x-select-text (text &optional push) | |
563 (if x-select-enable-clipboard | |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
564 (w32-set-clipboard-data text)) |
15048
1f316fa0e840
(x-select-text): Remember selected text.
Richard M. Stallman <rms@gnu.org>
parents:
14811
diff
changeset
|
565 (setq x-last-selected-text text)) |
13434 | 566 |
567 ;;; Return the value of the current selection. | |
568 ;;; Consult the selection, then the cut buffer. Treat empty strings | |
569 ;;; as if they were unset. | |
570 (defun x-get-selection-value () | |
571 (if x-select-enable-clipboard | |
572 (let (text) | |
573 ;; Don't die if x-get-selection signals an error. | |
574 (condition-case c | |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
575 (setq text (w32-get-clipboard-data)) |
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
576 (error (message "w32-get-clipboard-data:%s" c))) |
13434 | 577 (if (string= text "") (setq text nil)) |
15048
1f316fa0e840
(x-select-text): Remember selected text.
Richard M. Stallman <rms@gnu.org>
parents:
14811
diff
changeset
|
578 (cond |
1f316fa0e840
(x-select-text): Remember selected text.
Richard M. Stallman <rms@gnu.org>
parents:
14811
diff
changeset
|
579 ((not text) nil) |
1f316fa0e840
(x-select-text): Remember selected text.
Richard M. Stallman <rms@gnu.org>
parents:
14811
diff
changeset
|
580 ((eq text x-last-selected-text) nil) |
1f316fa0e840
(x-select-text): Remember selected text.
Richard M. Stallman <rms@gnu.org>
parents:
14811
diff
changeset
|
581 ((string= text x-last-selected-text) |
1f316fa0e840
(x-select-text): Remember selected text.
Richard M. Stallman <rms@gnu.org>
parents:
14811
diff
changeset
|
582 ;; Record the newer string, so subsequent calls can use the 'eq' test. |
1f316fa0e840
(x-select-text): Remember selected text.
Richard M. Stallman <rms@gnu.org>
parents:
14811
diff
changeset
|
583 (setq x-last-selected-text text) |
1f316fa0e840
(x-select-text): Remember selected text.
Richard M. Stallman <rms@gnu.org>
parents:
14811
diff
changeset
|
584 nil) |
1f316fa0e840
(x-select-text): Remember selected text.
Richard M. Stallman <rms@gnu.org>
parents:
14811
diff
changeset
|
585 (t |
1f316fa0e840
(x-select-text): Remember selected text.
Richard M. Stallman <rms@gnu.org>
parents:
14811
diff
changeset
|
586 (setq x-last-selected-text text)))))) |
13434 | 587 |
23636
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
588 (defalias 'x-cut-buffer-or-selection-value 'x-get-selection-value) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
589 |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
590 |
13434 | 591 ;;; Do the actual Windows setup here; the above code just defines |
592 ;;; functions and variables that we use now. | |
593 | |
594 (setq command-line-args (x-handle-args command-line-args)) | |
595 | |
596 ;;; Make sure we have a valid resource name. | |
597 (or (stringp x-resource-name) | |
598 (let (i) | |
599 (setq x-resource-name (invocation-name)) | |
600 | |
601 ;; Change any . or * characters in x-resource-name to hyphens, | |
602 ;; so as not to choke when we use it in X resource queries. | |
603 (while (setq i (string-match "[.*]" x-resource-name)) | |
604 (aset x-resource-name i ?-)))) | |
605 | |
606 ;; For the benefit of older Emacses (19.27 and earlier) that are sharing | |
607 ;; the same lisp directory, don't pass the third argument unless we seem | |
608 ;; to have the multi-display support. | |
609 (if (fboundp 'x-close-connection) | |
610 (x-open-connection "" | |
611 x-command-line-resources | |
612 ;; Exit Emacs with fatal error if this fails. | |
613 t) | |
614 (x-open-connection "" | |
615 x-command-line-resources)) | |
616 | |
617 (setq frame-creation-function 'x-create-frame-with-faces) | |
618 | |
619 (setq x-cut-buffer-max (min (- (/ (x-server-max-request-size) 2) 100) | |
620 x-cut-buffer-max)) | |
621 | |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
622 ;; W32 expects the menu bar cut and paste commands to use the clipboard. |
13434 | 623 ;; This has ,? to match both on Sunos and on Solaris. |
624 (menu-bar-enable-clipboard) | |
625 | |
23636
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
626 ;; 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
|
627 ;; we define our own standard fontset here. |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
628 (defvar w32-standard-fontset-spec |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
629 "-*-Courier New-normal-r-*-*-13-*-*-*-c-*-fontset-standard, |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
630 latin-iso8859-2:-*-Courier New CE-normal-r-*-*-13-*-*-*-c-*-iso8859-2, |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
631 latin-iso8859-3:-*-Courier New Tur-normal-r-*-*-13-*-*-*-c-*-iso8859-3, |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
632 latin-iso8859-4:-*-Courier New Baltic-normal-r-*-*-13-*-*-*-c-*-iso8859-4, |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
633 cyrillic-iso8859-5:-*-Courier New Cyr-normal-r-*-*-13-*-*-*-c-*-iso8859-5, |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
634 greek-iso8859-7:-*-Courier New Greek-normal-r-*-*-13-*-*-*-c-*-iso8859-7" |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
635 "String of fontset spec of the standard fontset. This defines a |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
636 fontset consisting of the Courier New variations for European |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
637 languages which are distributed with Windows as \"Multilanguage Support\". |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
638 |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
639 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
|
640 |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
641 (if (fboundp 'new-fontset) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
642 (progn |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
643 (defun w32-create-initial-fontsets () |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
644 "Create fontset-startup, fontset-standard and any fontsets |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
645 specified in X resources." |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
646 ;; Create the standard fontset. |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
647 (create-fontset-from-fontset-spec w32-standard-fontset-spec t) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
648 |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
649 ;; Create fontset specified in X resources "Fontset-N" (N is 0, 1,...). |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
650 (create-fontset-from-x-resource) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
651 |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
652 ;; Try to create a fontset from a font specification which comes |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
653 ;; from initial-frame-alist, default-frame-alist, or X resource. |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
654 ;; A font specification in command line argument (i.e. -fn XXXX) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
655 ;; should be already in default-frame-alist as a `font' |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
656 ;; parameter. However, any font specifications in site-start |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
657 ;; library, user's init file (.emacs), and default.el are not |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
658 ;; yet handled here. |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
659 |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
660 (let ((font (or (cdr (assq 'font initial-frame-alist)) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
661 (cdr (assq 'font default-frame-alist)) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
662 (x-get-resource "font" "Font"))) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
663 xlfd-fields resolved-name) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
664 (if (and font |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
665 (not (query-fontset font)) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
666 (setq resolved-name (x-resolve-font-name font)) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
667 (setq xlfd-fields (x-decompose-font-name font))) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
668 (if (string= "fontset" |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
669 (aref xlfd-fields xlfd-regexp-registry-subnum)) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
670 (new-fontset font |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
671 (x-complement-fontset-spec xlfd-fields nil)) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
672 ;; Create a fontset from FONT. The fontset name is |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
673 ;; generated from FONT. Create style variants of the |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
674 ;; fontset too. Font names in the variants are |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
675 ;; generated automatially unless X resources |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
676 ;; XXX.attribyteFont explicitly specify them. |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
677 (let ((styles (mapcar 'car x-style-funcs-alist)) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
678 (faces '(bold italic bold-italic)) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
679 face face-font fontset fontset-spec) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
680 (while faces |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
681 (setq face (car faces)) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
682 (setq face-font (x-get-resource (concat (symbol-name face) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
683 ".attributeFont") |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
684 "Face.AttributeFont")) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
685 (if face-font |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
686 (setq styles (cons (cons face face-font) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
687 (delq face styles)))) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
688 (setq faces (cdr faces))) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
689 (aset xlfd-fields xlfd-regexp-foundry-subnum nil) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
690 (aset xlfd-fields xlfd-regexp-family-subnum nil) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
691 (aset xlfd-fields xlfd-regexp-registry-subnum "fontset") |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
692 (aset xlfd-fields xlfd-regexp-encoding-subnum "startup") |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
693 ;; The fontset name should have concrete values in |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
694 ;; weight and slant field. |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
695 (let ((weight (aref xlfd-fields xlfd-regexp-weight-subnum)) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
696 (slant (aref xlfd-fields xlfd-regexp-slant-subnum)) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
697 xlfd-temp) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
698 (if (or (not weight) (string-match "[*?]*" weight)) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
699 (progn |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
700 (setq xlfd-temp |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
701 (x-decompose-font-name resolved-name)) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
702 (aset xlfd-fields xlfd-regexp-weight-subnum |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
703 (aref xlfd-temp xlfd-regexp-weight-subnum)))) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
704 (if (or (not slant) (string-match "[*?]*" slant)) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
705 (progn |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
706 (or xlfd-temp |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
707 (setq xlfd-temp |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
708 (x-decompose-font-name resolved-name))) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
709 (aset xlfd-fields xlfd-regexp-slant-subnum |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
710 (aref xlfd-temp xlfd-regexp-slant-subnum))))) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
711 (setq fontset (x-compose-font-name xlfd-fields)) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
712 (create-fontset-from-fontset-spec |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
713 (concat fontset ", ascii:" font) styles) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
714 ))))) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
715 ;; This cannot be run yet, as creating fontsets requires a |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
716 ;; Window to be initialised so the fonts can be listed. |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
717 ;; Add it to a hook so it gets run later. |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
718 (add-hook 'before-init-hook 'w32-create-initial-fontsets) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
719 )) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
720 |
13434 | 721 ;; Apply a geometry resource to the initial frame. Put it at the end |
722 ;; of the alist, so that anything specified on the command line takes | |
723 ;; precedence. | |
724 (let* ((res-geometry (x-get-resource "geometry" "Geometry")) | |
725 parsed) | |
726 (if res-geometry | |
727 (progn | |
728 (setq parsed (x-parse-geometry res-geometry)) | |
729 ;; If the resource specifies a position, | |
730 ;; call the position and size "user-specified". | |
731 (if (or (assq 'top parsed) (assq 'left parsed)) | |
732 (setq parsed (cons '(user-position . t) | |
733 (cons '(user-size . t) parsed)))) | |
734 ;; All geometry parms apply to the initial frame. | |
735 (setq initial-frame-alist (append initial-frame-alist parsed)) | |
736 ;; The size parms apply to all frames. | |
737 (if (assq 'height parsed) | |
738 (setq default-frame-alist | |
739 (cons (cons 'height (cdr (assq 'height parsed))) | |
740 default-frame-alist))) | |
741 (if (assq 'width parsed) | |
742 (setq default-frame-alist | |
743 (cons (cons 'width (cdr (assq 'width parsed))) | |
744 default-frame-alist)))))) | |
745 | |
746 ;; Check the reverseVideo resource. | |
747 (let ((case-fold-search t)) | |
748 (let ((rv (x-get-resource "reverseVideo" "ReverseVideo"))) | |
749 (if (and rv | |
750 (string-match "^\\(true\\|yes\\|on\\)$" rv)) | |
751 (setq default-frame-alist | |
752 (cons '(reverse . t) default-frame-alist))))) | |
753 | |
754 ;; Set x-selection-timeout, measured in milliseconds. | |
755 (let ((res-selection-timeout | |
756 (x-get-resource "selectionTimeout" "SelectionTimeout"))) | |
757 (setq x-selection-timeout 20000) | |
758 (if res-selection-timeout | |
759 (setq x-selection-timeout (string-to-number res-selection-timeout)))) | |
760 | |
761 (defun x-win-suspend-error () | |
16889
8de32e992e4d
Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16596
diff
changeset
|
762 (error "Suspending an emacs running under W32 makes no sense")) |
13434 | 763 (add-hook 'suspend-hook 'x-win-suspend-error) |
764 | |
765 ;;; Arrange for the kill and yank functions to set and check the clipboard. | |
766 (setq interprogram-cut-function 'x-select-text) | |
767 (setq interprogram-paste-function 'x-get-selection-value) | |
768 | |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
769 ;;; Turn off window-splitting optimization; w32 is usually fast enough |
13434 | 770 ;;; that this is only annoying. |
771 (setq split-window-keep-point t) | |
772 | |
773 ;; 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
|
774 (setq-default mode-line-frame-identification " ") |
13434 | 775 |
776 ;;; Set to a system sound if you want a fancy bell. | |
777 (set-message-beep 'ok) | |
778 | |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15265
diff
changeset
|
779 ;; Remap some functions to call w32 common dialogs |
13434 | 780 |
781 (defun internal-face-interactive (what &optional bool) | |
782 (let* ((fn (intern (concat "face-" what))) | |
783 (prompt (concat "Set " what " of face")) | |
784 (face (read-face-name (concat prompt ": "))) | |
785 (default (if (fboundp fn) | |
786 (or (funcall fn face (selected-frame)) | |
787 (funcall fn 'default (selected-frame))))) | |
788 (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
|
789 value) |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
790 (setq value |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
791 (cond ((fboundp fn-win) |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
792 (funcall fn-win)) |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
793 ((eq bool 'color) |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
794 (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
|
795 (mapcar (function (lambda (color) |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
796 (cons color color))) |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
797 x-colors) |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
798 nil nil nil nil default)) |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
799 (bool |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
800 (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
|
801 " be " bool "? "))) |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
802 (t |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
803 (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
|
804 nil nil default)))) |
45ccce07729d
(internal-face-interactive): Handle case where BOOL is `color'.
Andrew Innes <andrewi@gnu.org>
parents:
21883
diff
changeset
|
805 (list face (if (equal value "") nil value)))) |
13434 | 806 |
16889
8de32e992e4d
Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16596
diff
changeset
|
807 ;; 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
|
808 (defvar w32-use-w32-font-dialog t |
23636
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
809 "*Use the standard font dialog if 't' - otherwise pop up a menu of |
23560
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
810 some standard fonts like X does - including fontsets") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
811 |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
812 (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
|
813 '("Font menu" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
814 ("Misc" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
815 ;; 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
|
816 ("fixed" "Fixedsys") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
817 ("") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
818 ("Terminal 5x4" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
819 "-*-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
|
820 ("Terminal 6x8" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
821 "-*-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
|
822 ("Terminal 9x5" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
823 "-*-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
|
824 ("Terminal 9x7" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
825 "-*-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
|
826 ("Terminal 9x8" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
827 "-*-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
|
828 ("Terminal 12x12" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
829 "-*-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
|
830 ("Terminal 14x10" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
831 "-*-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
|
832 ("Terminal 6x6 Bold" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
833 "-*-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
|
834 ("") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
835 ("Lucida Sans Typewriter.8" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
836 "-*-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
|
837 ("Lucida Sans Typewriter.9" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
838 "-*-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
|
839 ("Lucida Sans Typewriter.10" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
840 "-*-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
|
841 ("Lucida Sans Typewriter.11" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
842 "-*-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
|
843 ("Lucida Sans Typewriter.12" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
844 "-*-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
|
845 ("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
|
846 "-*-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
|
847 ("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
|
848 "-*-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
|
849 ("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
|
850 "-*-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
|
851 ("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
|
852 "-*-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
|
853 ("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
|
854 "-*-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
|
855 ("Courier" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
856 ("Courier 10x8" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
857 "-*-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
|
858 ("Courier 12x9" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
859 "-*-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
|
860 ("Courier 15x12" |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
861 "-*-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
|
862 ;; 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
|
863 ("") |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
864 ("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
|
865 ("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
|
866 ("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
|
867 ("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
|
868 ("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
|
869 ("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
|
870 ("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
|
871 ("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
|
872 ("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
|
873 ("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
|
874 ("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
|
875 ("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
|
876 ("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
|
877 ("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
|
878 ("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
|
879 ("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
|
880 ("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
|
881 ("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
|
882 ("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
|
883 ("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
|
884 )) |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
885 "Fonts suitable for use in Emacs. Initially this is a list of some |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
886 fixed width fonts that most people will have like Terminal and |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
887 Courier. These fonts are used in the font menu if the variable |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
888 `w32-use-w32-font-dialog' is nil.") |
13434 | 889 |
890 (defun mouse-set-font (&rest fonts) | |
23560
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
891 (interactive |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
892 (if w32-use-w32-font-dialog |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
893 (list (w32-select-font)) |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
894 (x-popup-menu |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
895 last-nonmenu-event |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
896 ;; Append list of fontsets currently defined. |
23636
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
897 (if (fboundp 'new-fontset) |
3246160c5469
(x-get-selection-value): Alias to
Geoff Voelker <voelker@cs.washington.edu>
parents:
23625
diff
changeset
|
898 (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
|
899 (if fonts |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
900 (let (font) |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
901 (while fonts |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
902 (condition-case nil |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
903 (progn |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
904 (set-default-font (car fonts)) |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
905 (setq font (car fonts)) |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
906 (setq fonts nil)) |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
907 (error |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
908 (setq fonts (cdr fonts))))) |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
909 (if (null font) |
6414b7085648
(w32-use-w32-font-dialog, w32-fixed-font-alist):
Geoff Voelker <voelker@cs.washington.edu>
parents:
22539
diff
changeset
|
910 (error "Font not found"))))) |
13434 | 911 |
16889
8de32e992e4d
Change uses of win32 to w32.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16596
diff
changeset
|
912 ;;; w32-win.el ends here |