13434
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
1 ;;; win32-win.el --- parse switches controlling interface with win32
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
2 ;; Copyright (C) 1993, 1994 Free Software Foundation, Inc.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
3
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
4 ;; Author: Kevin Gallo
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
5 ;; Keywords: terminals
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
6
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
7 ;;; This file is part of GNU Emacs.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
8 ;;;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
9 ;;; GNU Emacs is free software; you can redistribute it and/or modify
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
10 ;;; it under the terms of the GNU General Public License as published by
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
11 ;;; the Free Software Foundation; either version 2, or (at your option)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
12 ;;; any later version.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
13 ;;;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
14 ;;; GNU Emacs is distributed in the hope that it will be useful,
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
15 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
17 ;;; GNU General Public License for more details.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
18 ;;;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
19 ;;; You should have received a copy of the GNU General Public License
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
20 ;;; along with GNU Emacs; see the file COPYING. If not, write to
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
21 ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
22
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
23 ;;; Commentary:
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
24
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
25 ;; win32-win.el: this file is loaded from ../lisp/startup.el when it recognizes
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
26 ;; that win32 windows are to be used. Command line switches are parsed and those
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
27 ;; pertaining to win32 are processed and removed from the command line. The
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
28 ;; win32 display is opened and hooks are set for popping up the initial window.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
29
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
30 ;; startup.el will then examine startup files, and eventually call the hooks
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
31 ;; which create the first window (s).
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
32
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
33 ;;; Code:
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
34
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
35
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
36 ;; These are the standard X switches from the Xt Initialize.c file of
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
37 ;; Release 4.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
38
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
39 ;; Command line Resource Manager string
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
40
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
41 ;; +rv *reverseVideo
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
42 ;; +synchronous *synchronous
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
43 ;; -background *background
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
44 ;; -bd *borderColor
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
45 ;; -bg *background
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
46 ;; -bordercolor *borderColor
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
47 ;; -borderwidth .borderWidth
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
48 ;; -bw .borderWidth
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
49 ;; -display .display
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
50 ;; -fg *foreground
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
51 ;; -fn *font
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
52 ;; -font *font
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
53 ;; -foreground *foreground
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
54 ;; -geometry .geometry
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
55 ;; -i .iconType
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
56 ;; -itype .iconType
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
57 ;; -iconic .iconic
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
58 ;; -name .name
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
59 ;; -reverse *reverseVideo
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
60 ;; -rv *reverseVideo
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
61 ;; -selectionTimeout .selectionTimeout
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
62 ;; -synchronous *synchronous
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
63 ;; -xrm
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
64
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
65 ;; An alist of X options and the function which handles them. See
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
66 ;; ../startup.el.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
67
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
68 (if (not (eq window-system 'win32))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
69 (error "%s: Loading win32-win.el but not compiled for win32" (invocation-name)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
70
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
71 (require 'frame)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
72 (require 'mouse)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
73 (require 'scroll-bar)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
74 (require 'faces)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
75 (require 'select)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
76 (require 'menu-bar)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
77
|
13831
|
78 ;; Disable until scrollbars are fully functional
|
|
79 (scroll-bar-mode nil)
|
|
80
|
13434
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
81 (defvar x-invocation-args)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
82
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
83 (defvar x-command-line-resources nil)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
84
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
85 (defconst x-option-alist
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
86 '(("-bw" . x-handle-numeric-switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
87 ("-d" . x-handle-display)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
88 ("-display" . x-handle-display)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
89 ("-name" . x-handle-name-rn-switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
90 ("-rn" . x-handle-name-rn-switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
91 ("-T" . x-handle-switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
92 ("-r" . x-handle-switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
93 ("-rv" . x-handle-switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
94 ("-reverse" . x-handle-switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
95 ("-fn" . x-handle-switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
96 ("-font" . x-handle-switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
97 ("-ib" . x-handle-numeric-switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
98 ("-g" . x-handle-geometry)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
99 ("-geometry" . x-handle-geometry)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
100 ("-fg" . x-handle-switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
101 ("-foreground". x-handle-switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
102 ("-bg" . x-handle-switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
103 ("-background". x-handle-switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
104 ("-ms" . x-handle-switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
105 ("-itype" . x-handle-switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
106 ("-i" . x-handle-switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
107 ("-iconic" . x-handle-iconic)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
108 ("-xrm" . x-handle-xrm-switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
109 ("-cr" . x-handle-switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
110 ("-vb" . x-handle-switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
111 ("-hb" . x-handle-switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
112 ("-bd" . x-handle-switch)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
113
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
114 (defconst x-long-option-alist
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
115 '(("--border-width" . "-bw")
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
116 ("--display" . "-d")
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
117 ("--name" . "-name")
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
118 ("--title" . "-T")
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
119 ("--reverse-video" . "-reverse")
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
120 ("--font" . "-font")
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
121 ("--internal-border" . "-ib")
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
122 ("--geometry" . "-geometry")
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
123 ("--foreground-color" . "-fg")
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
124 ("--background-color" . "-bg")
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
125 ("--mouse-color" . "-ms")
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
126 ("--icon-type" . "-itype")
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
127 ("--iconic" . "-iconic")
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
128 ("--xrm" . "-xrm")
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
129 ("--cursor-color" . "-cr")
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
130 ("--vertical-scroll-bars" . "-vb")
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
131 ("--border-color" . "-bd")))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
132
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
133 (defconst x-switch-definitions
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
134 '(("-name" name)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
135 ("-T" name)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
136 ("-r" reverse t)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
137 ("-rv" reverse t)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
138 ("-reverse" reverse t)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
139 ("-fn" font)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
140 ("-font" font)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
141 ("-ib" internal-border-width)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
142 ("-fg" foreground-color)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
143 ("-foreground" foreground-color)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
144 ("-bg" background-color)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
145 ("-background" background-color)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
146 ("-ms" mouse-color)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
147 ("-cr" cursor-color)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
148 ("-itype" icon-type t)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
149 ("-i" icon-type t)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
150 ("-vb" vertical-scroll-bars t)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
151 ("-hb" horizontal-scroll-bars t)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
152 ("-bd" border-color)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
153 ("-bw" border-width)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
154
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
155 ;; Handler for switches of the form "-switch value" or "-switch".
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
156 (defun x-handle-switch (switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
157 (let ((aelt (assoc switch x-switch-definitions)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
158 (if aelt
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
159 (if (nth 2 aelt)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
160 (setq default-frame-alist
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
161 (cons (cons (nth 1 aelt) (nth 2 aelt))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
162 default-frame-alist))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
163 (setq default-frame-alist
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
164 (cons (cons (nth 1 aelt)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
165 (car x-invocation-args))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
166 default-frame-alist)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
167 x-invocation-args (cdr x-invocation-args))))))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
168
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
169 ;; Make -iconic apply only to the initial frame!
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
170 (defun x-handle-iconic (switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
171 (setq initial-frame-alist
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
172 (cons '(visibility . icon) initial-frame-alist)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
173
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
174 ;; Handler for switches of the form "-switch n"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
175 (defun x-handle-numeric-switch (switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
176 (let ((aelt (assoc switch x-switch-definitions)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
177 (if aelt
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
178 (setq default-frame-alist
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
179 (cons (cons (nth 1 aelt)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
180 (string-to-int (car x-invocation-args)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
181 default-frame-alist)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
182 x-invocation-args
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
183 (cdr x-invocation-args)))))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
184
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
185 ;; Handle the -xrm option.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
186 (defun x-handle-xrm-switch (switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
187 (or (consp x-invocation-args)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
188 (error "%s: missing argument to `%s' option" (invocation-name) switch))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
189 (setq x-command-line-resources (car x-invocation-args))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
190 (setq x-invocation-args (cdr x-invocation-args)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
191
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
192 ;; Handle the geometry option
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
193 (defun x-handle-geometry (switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
194 (let ((geo (x-parse-geometry (car x-invocation-args))))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
195 (setq initial-frame-alist
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
196 (append initial-frame-alist
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
197 (if (or (assq 'left geo) (assq 'top geo))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
198 '((user-position . t)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
199 (if (or (assq 'height geo) (assq 'width geo))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
200 '((user-size . t)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
201 geo)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
202 x-invocation-args (cdr x-invocation-args))))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
203
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
204 ;; Handle the -name and -rn options. Set the variable x-resource-name
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
205 ;; to the option's operand; if the switch was `-name', set the name of
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
206 ;; the initial frame, too.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
207 (defun x-handle-name-rn-switch (switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
208 (or (consp x-invocation-args)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
209 (error "%s: missing argument to `%s' option" (invocation-name) switch))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
210 (setq x-resource-name (car x-invocation-args)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
211 x-invocation-args (cdr x-invocation-args))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
212 (if (string= switch "-name")
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
213 (setq initial-frame-alist (cons (cons 'name x-resource-name)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
214 initial-frame-alist))))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
215
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
216 (defvar x-display-name nil
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
217 "The display name specifying server and frame.")
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
218
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
219 (defun x-handle-display (switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
220 (setq x-display-name (car x-invocation-args)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
221 x-invocation-args (cdr x-invocation-args)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
222
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
223 (defvar x-invocation-args nil)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
224
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
225 (defun x-handle-args (args)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
226 "Process the X-related command line options in ARGS.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
227 This is done before the user's startup file is loaded. They are copied to
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
228 x-invocation args from which the X-related things are extracted, first
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
229 the switch (e.g., \"-fg\") in the following code, and possible values
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
230 \(e.g., \"black\") in the option handler code (e.g., x-handle-switch).
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
231 This returns ARGS with the arguments that have been processed removed."
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
232 (message "%s" args)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
233 (setq x-invocation-args args
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
234 args nil)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
235 (while x-invocation-args
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
236 (let* ((this-switch (car x-invocation-args))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
237 (orig-this-switch this-switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
238 completion argval aelt)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
239 (setq x-invocation-args (cdr x-invocation-args))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
240 ;; Check for long options with attached arguments
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
241 ;; and separate out the attached option argument into argval.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
242 (if (string-match "^--[^=]*=" this-switch)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
243 (setq argval (substring this-switch (match-end 0))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
244 this-switch (substring this-switch 0 (1- (match-end 0)))))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
245 (setq completion (try-completion this-switch x-long-option-alist))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
246 (if (eq completion t)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
247 ;; Exact match for long option.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
248 (setq this-switch (cdr (assoc this-switch x-long-option-alist)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
249 (if (stringp completion)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
250 (let ((elt (assoc completion x-long-option-alist)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
251 ;; Check for abbreviated long option.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
252 (or elt
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
253 (error "Option `%s' is ambiguous" this-switch))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
254 (setq this-switch (cdr elt)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
255 ;; Check for a short option.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
256 (setq argval nil this-switch orig-this-switch)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
257 (setq aelt (assoc this-switch x-option-alist))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
258 (if aelt
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
259 (if argval
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
260 (let ((x-invocation-args
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
261 (cons argval x-invocation-args)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
262 (funcall (cdr aelt) this-switch))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
263 (funcall (cdr aelt) this-switch))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
264 (setq args (cons this-switch args)))))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
265 (setq args (nreverse args)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
266
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
267
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
268
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
269 ;;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
270 ;; Available colors
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
271 ;;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
272
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
273 (defvar x-colors '("aquamarine"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
274 "Aquamarine"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
275 "medium aquamarine"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
276 "MediumAquamarine"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
277 "black"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
278 "Black"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
279 "blue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
280 "Blue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
281 "cadet blue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
282 "CadetBlue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
283 "cornflower blue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
284 "CornflowerBlue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
285 "dark slate blue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
286 "DarkSlateBlue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
287 "light blue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
288 "LightBlue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
289 "light steel blue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
290 "LightSteelBlue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
291 "medium blue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
292 "MediumBlue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
293 "medium slate blue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
294 "MediumSlateBlue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
295 "midnight blue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
296 "MidnightBlue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
297 "navy blue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
298 "NavyBlue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
299 "navy"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
300 "Navy"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
301 "sky blue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
302 "SkyBlue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
303 "slate blue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
304 "SlateBlue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
305 "steel blue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
306 "SteelBlue"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
307 "coral"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
308 "Coral"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
309 "cyan"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
310 "Cyan"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
311 "firebrick"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
312 "Firebrick"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
313 "brown"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
314 "Brown"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
315 "gold"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
316 "Gold"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
317 "goldenrod"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
318 "Goldenrod"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
319 "green"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
320 "Green"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
321 "dark green"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
322 "DarkGreen"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
323 "dark olive green"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
324 "DarkOliveGreen"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
325 "forest green"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
326 "ForestGreen"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
327 "lime green"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
328 "LimeGreen"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
329 "medium sea green"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
330 "MediumSeaGreen"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
331 "medium spring green"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
332 "MediumSpringGreen"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
333 "pale green"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
334 "PaleGreen"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
335 "sea green"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
336 "SeaGreen"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
337 "spring green"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
338 "SpringGreen"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
339 "yellow green"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
340 "YellowGreen"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
341 "dark slate grey"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
342 "DarkSlateGrey"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
343 "dark slate gray"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
344 "DarkSlateGray"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
345 "dim grey"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
346 "DimGrey"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
347 "dim gray"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
348 "DimGray"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
349 "light grey"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
350 "LightGrey"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
351 "light gray"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
352 "LightGray"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
353 "gray"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
354 "grey"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
355 "Gray"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
356 "Grey"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
357 "khaki"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
358 "Khaki"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
359 "magenta"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
360 "Magenta"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
361 "maroon"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
362 "Maroon"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
363 "orange"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
364 "Orange"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
365 "orchid"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
366 "Orchid"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
367 "dark orchid"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
368 "DarkOrchid"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
369 "medium orchid"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
370 "MediumOrchid"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
371 "pink"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
372 "Pink"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
373 "plum"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
374 "Plum"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
375 "red"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
376 "Red"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
377 "indian red"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
378 "IndianRed"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
379 "medium violet red"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
380 "MediumVioletRed"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
381 "orange red"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
382 "OrangeRed"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
383 "violet red"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
384 "VioletRed"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
385 "salmon"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
386 "Salmon"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
387 "sienna"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
388 "Sienna"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
389 "tan"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
390 "Tan"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
391 "thistle"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
392 "Thistle"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
393 "turquoise"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
394 "Turquoise"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
395 "dark turquoise"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
396 "DarkTurquoise"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
397 "medium turquoise"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
398 "MediumTurquoise"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
399 "violet"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
400 "Violet"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
401 "blue violet"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
402 "BlueViolet"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
403 "wheat"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
404 "Wheat"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
405 "white"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
406 "White"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
407 "yellow"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
408 "Yellow"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
409 "green yellow"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
410 "GreenYellow")
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
411 "The full list of X colors from the `rgb.text' file.")
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
412
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
413 (defun x-defined-colors (&optional frame)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
414 "Return a list of colors supported for a particular frame.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
415 The argument FRAME specifies which frame to try.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
416 The value may be different for frames on different X displays."
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
417 (or frame (setq frame (selected-frame)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
418 (let ((all-colors x-colors)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
419 (this-color nil)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
420 (defined-colors nil))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
421 (while all-colors
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
422 (setq this-color (car all-colors)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
423 all-colors (cdr all-colors))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
424 (and (face-color-supported-p frame this-color t)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
425 (setq defined-colors (cons this-color defined-colors))))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
426 defined-colors))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
427
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
428 ;;;; Function keys
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
429
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
430 (defun iconify-or-deiconify-frame ()
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
431 "Iconify the selected frame, or deiconify if it's currently an icon."
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
432 (interactive)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
433 (if (eq (cdr (assq 'visibility (frame-parameters))) t)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
434 (iconify-frame)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
435 (make-frame-visible)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
436
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
437 (substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
438 global-map)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
439
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
440 ;; Map certain keypad keys into ASCII characters
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
441 ;; that people usually expect.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
442 (define-key function-key-map [backspace] [127])
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
443 (define-key function-key-map [delete] [127])
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
444 (define-key function-key-map [tab] [?\t])
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
445 (define-key function-key-map [linefeed] [?\n])
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
446 (define-key function-key-map [clear] [11])
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
447 (define-key function-key-map [return] [13])
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
448 (define-key function-key-map [escape] [?\e])
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
449 (define-key function-key-map [M-backspace] [?\M-\d])
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
450 (define-key function-key-map [M-delete] [?\M-\d])
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
451 (define-key function-key-map [M-tab] [?\M-\t])
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
452 (define-key function-key-map [M-linefeed] [?\M-\n])
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
453 (define-key function-key-map [M-clear] [?\M-\013])
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
454 (define-key function-key-map [M-return] [?\M-\015])
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
455 (define-key function-key-map [M-escape] [?\M-\e])
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
456
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
457 ;; These tell read-char how to convert
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
458 ;; these special chars to ASCII.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
459 (put 'backspace 'ascii-character 127)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
460 (put 'delete 'ascii-character 127)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
461 (put 'tab 'ascii-character ?\t)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
462 (put 'linefeed 'ascii-character ?\n)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
463 (put 'clear 'ascii-character 12)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
464 (put 'return 'ascii-character 13)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
465 (put 'escape 'ascii-character ?\e)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
466
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
467
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
468 ;;;; Selections and cut buffers
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
469
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
470 ;;; We keep track of the last text selected here, so we can check the
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
471 ;;; current selection against it, and avoid passing back our own text
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
472 ;;; from x-cut-buffer-or-selection-value.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
473 (defvar x-last-selected-text nil)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
474
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
475 ;;; It is said that overlarge strings are slow to put into the cut buffer.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
476 ;;; Note this value is overridden below.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
477 (defvar x-cut-buffer-max 20000
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
478 "Max number of characters to put in the cut buffer.")
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
479
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
480 (defvar x-select-enable-clipboard t
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
481 "Non-nil means cutting and pasting uses the clipboard.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
482 This is in addition to the primary selection.")
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
483
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
484 (defun x-select-text (text &optional push)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
485 (if x-select-enable-clipboard
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
486 (win32-set-clipboard-data text)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
487
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
488 ;;; Return the value of the current selection.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
489 ;;; Consult the selection, then the cut buffer. Treat empty strings
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
490 ;;; as if they were unset.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
491 (defun x-get-selection-value ()
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
492 (if x-select-enable-clipboard
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
493 (let (text)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
494 ;; Don't die if x-get-selection signals an error.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
495 (condition-case c
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
496 (setq text (win32-get-clipboard-data))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
497 (error (message "win32-get-clipboard-data:%s" c)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
498 (if (string= text "") (setq text nil))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
499 text)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
500
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
501 ;;; Do the actual Windows setup here; the above code just defines
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
502 ;;; functions and variables that we use now.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
503
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
504 (setq command-line-args (x-handle-args command-line-args))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
505
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
506 ;;; Make sure we have a valid resource name.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
507 (or (stringp x-resource-name)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
508 (let (i)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
509 (setq x-resource-name (invocation-name))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
510
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
511 ;; Change any . or * characters in x-resource-name to hyphens,
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
512 ;; so as not to choke when we use it in X resource queries.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
513 (while (setq i (string-match "[.*]" x-resource-name))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
514 (aset x-resource-name i ?-))))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
515
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
516 ;; For the benefit of older Emacses (19.27 and earlier) that are sharing
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
517 ;; the same lisp directory, don't pass the third argument unless we seem
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
518 ;; to have the multi-display support.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
519 (if (fboundp 'x-close-connection)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
520 (x-open-connection ""
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
521 x-command-line-resources
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
522 ;; Exit Emacs with fatal error if this fails.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
523 t)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
524 (x-open-connection ""
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
525 x-command-line-resources))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
526
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
527 (setq frame-creation-function 'x-create-frame-with-faces)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
528
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
529 (setq x-cut-buffer-max (min (- (/ (x-server-max-request-size) 2) 100)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
530 x-cut-buffer-max))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
531
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
532 ;; Win32 expects the menu bar cut and paste commands to use the clipboard.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
533 ;; This has ,? to match both on Sunos and on Solaris.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
534 (menu-bar-enable-clipboard)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
535
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
536 ;; Apply a geometry resource to the initial frame. Put it at the end
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
537 ;; of the alist, so that anything specified on the command line takes
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
538 ;; precedence.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
539 (let* ((res-geometry (x-get-resource "geometry" "Geometry"))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
540 parsed)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
541 (if res-geometry
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
542 (progn
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
543 (setq parsed (x-parse-geometry res-geometry))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
544 ;; If the resource specifies a position,
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
545 ;; call the position and size "user-specified".
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
546 (if (or (assq 'top parsed) (assq 'left parsed))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
547 (setq parsed (cons '(user-position . t)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
548 (cons '(user-size . t) parsed))))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
549 ;; All geometry parms apply to the initial frame.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
550 (setq initial-frame-alist (append initial-frame-alist parsed))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
551 ;; The size parms apply to all frames.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
552 (if (assq 'height parsed)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
553 (setq default-frame-alist
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
554 (cons (cons 'height (cdr (assq 'height parsed)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
555 default-frame-alist)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
556 (if (assq 'width parsed)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
557 (setq default-frame-alist
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
558 (cons (cons 'width (cdr (assq 'width parsed)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
559 default-frame-alist))))))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
560
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
561 ;; Check the reverseVideo resource.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
562 (let ((case-fold-search t))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
563 (let ((rv (x-get-resource "reverseVideo" "ReverseVideo")))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
564 (if (and rv
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
565 (string-match "^\\(true\\|yes\\|on\\)$" rv))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
566 (setq default-frame-alist
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
567 (cons '(reverse . t) default-frame-alist)))))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
568
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
569 ;; Set x-selection-timeout, measured in milliseconds.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
570 (let ((res-selection-timeout
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
571 (x-get-resource "selectionTimeout" "SelectionTimeout")))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
572 (setq x-selection-timeout 20000)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
573 (if res-selection-timeout
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
574 (setq x-selection-timeout (string-to-number res-selection-timeout))))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
575
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
576 (defun x-win-suspend-error ()
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
577 (error "Suspending an emacs running under Win32 makes no sense"))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
578 (add-hook 'suspend-hook 'x-win-suspend-error)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
579
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
580 ;;; Arrange for the kill and yank functions to set and check the clipboard.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
581 (setq interprogram-cut-function 'x-select-text)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
582 (setq interprogram-paste-function 'x-get-selection-value)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
583
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
584 ;;; Turn off window-splitting optimization; win32 is usually fast enough
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
585 ;;; that this is only annoying.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
586 (setq split-window-keep-point t)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
587
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
588 ;; Don't show the frame name; that's redundant.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
589 (setq-default mode-line-buffer-identification '("Emacs: %12b"))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
590
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
591 ;;; Set to a system sound if you want a fancy bell.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
592 (set-message-beep 'ok)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
593
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
594 ;; Remap some functions to call win32 common dialogs
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
595
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
596 (defun internal-face-interactive (what &optional bool)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
597 (let* ((fn (intern (concat "face-" what)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
598 (prompt (concat "Set " what " of face"))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
599 (face (read-face-name (concat prompt ": ")))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
600 (default (if (fboundp fn)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
601 (or (funcall fn face (selected-frame))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
602 (funcall fn 'default (selected-frame)))))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
603 (fn-win (intern (concat (symbol-name window-system) "-select-" what)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
604 (value
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
605 (if (fboundp fn-win)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
606 (funcall fn-win)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
607 (if bool
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
608 (y-or-n-p (concat "Should face " (symbol-name face)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
609 " be " bool "? "))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
610 (read-string (concat prompt " " (symbol-name face) " to: ")
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
611 default)))))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
612 (list face (if (equal value "") nil value))))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
613
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
614 ;; Redefine the font selection to use the Win32 dialog
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
615
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
616 (defun mouse-set-font (&rest fonts)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
617 (interactive)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
618 (set-default-font (win32-select-font)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
619
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
620 ;;; win32-win.el ends here
|