annotate lisp/term/x-win.el @ 54:bacfccb982c9

Initial revision
author Jim Blandy <jimb@redhat.com>
date Thu, 22 Mar 1990 20:46:04 +0000
parents
children b469d69e9f03
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1 ;; Parse switches controlling how Emacs interfaces with X window system.
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2 ;; Copyright (C) 1990 Free Software Foundation, Inc.
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4 ;; This file is part of GNU Emacs.
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6 ;; GNU Emacs is distributed in the hope that it will be useful,
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7 ;; but WITHOUT ANY WARRANTY. No author or distributor
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
8 ;; accepts responsibility to anyone for the consequences of using it
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9 ;; or for whether it serves any particular purpose or works at all,
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10 ;; unless he says so in writing. Refer to the GNU Emacs General Public
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11 ;; License for full details.
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 ;; Everyone is granted permission to copy, modify and redistribute
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 ;; GNU Emacs, but only under the conditions described in the
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15 ;; GNU Emacs General Public License. A copy of this license is
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16 ;; supposed to have been given to you along with GNU Emacs so you
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17 ;; can know your rights and responsibilities. It should be in a
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
18 ;; file named COPYING. Among other things, the copyright notice
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
19 ;; and this notice must be preserved on all copies.
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
21
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22 ;; X-win.el: this file is loaded from ../lisp/startup.el when it recognizes
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
23 ;; that X windows are to be used. Command line switches are parsed and those
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
24 ;; pertaining to X are processed and removed from the command line. The
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
25 ;; X display is opened and hooks are set for popping up the initial window.
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
26
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
27 ;; startup.el will then examine startup files, and eventually call the hooks
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
28 ;; which create the first window (s).
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
29
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
30 ;; These are the standard X switches from the Xt Initialize.c file of
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
31 ;; Release 4.
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
32
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
33 ;; Command line Resource Manager string
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
34
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
35 ;; +rv *reverseVideo
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
36 ;; +synchronous *synchronous
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
37 ;; -background *background
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
38 ;; -bd *borderColor
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
39 ;; -bg *background
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40 ;; -bordercolor *borderColor
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41 ;; -borderwidth .borderWidth
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42 ;; -bw .borderWidth
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43 ;; -display .display
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
44 ;; -fg *foreground
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
45 ;; -fn *font
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
46 ;; -font *font
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
47 ;; -foreground *foreground
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
48 ;; -geometry .geometry
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
49 ;; -iconic .iconic
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
50 ;; -name .name
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
51 ;; -reverse *reverseVideo
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
52 ;; -rv *reverseVideo
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
53 ;; -selectionTimeout .selectionTimeout
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
54 ;; -synchronous *synchronous
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
55 ;; -title .title
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
56 ;; -xrm
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
57
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
58 (message "X-windows...")
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
59
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
60 ;; An alist of X options and the function which handles them. See
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
61 ;; ../startup.el.
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
62
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
63 (setq command-switch-alist
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
64 (append '(("-dm" . x-establish-daemon-mode)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
65 ("-bw" . x-handle-numeric-switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
66 ("-d" . x-handle-display)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
67 ("-display" . x-handle-display)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
68 ("-name" . x-handle-switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
69 ("-T" . x-handle-switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
70 ("-r" . x-handle-switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
71 ("-rv" . x-handle-switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
72 ("-reverse" . x-handle-switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
73 ("-fn" . x-handle-switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
74 ("-font" . x-handle-switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
75 ("-ib" . x-handle-switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
76 ("-g" . x-handle-geometry)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
77 ("-geometry" . x-handle-geometry)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
78 ("-fg" . x-handle-switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
79 ("-foreground" . x-handle-switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
80 ("-bg" . x-handle-switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
81 ("-background" . x-handle-switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
82 ("-ms" . x-handle-switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
83 ("-ib" . x-handle-switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
84 ("-iconic" . x-handle-switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
85 ("-cr" . x-handle-switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
86 ("-vb" . x-handle-switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
87 ("-hb" . x-handle-switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
88 ("-bd" . x-handle-switch))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
89 command-switch-alist))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
90
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
91 (defvar x-switches-specified nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
92
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
93 (defconst x-switch-definitions
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
94 '(("-name" name)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
95 ("-T" name)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
96 ("-r" lose)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
97 ("-rv" lose)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
98 ("-reverse" lose)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
99 ("-fn" font)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
100 ("-font" font)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
101 ("-ib" internal-border-width)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
102 ("-fg" foreground-color)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
103 ("-foreground" foreground-color)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
104 ("-bg" background-color)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
105 ("-background" background-color)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
106 ("-ms" mouse-color)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
107 ("-cr" cursor-color)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
108 ("-ib" icon-type t)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
109 ("-iconic" iconic-startup t)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
110 ("-vb" vertical-scroll-bar t)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
111 ("-hb" horizontal-scroll-bar t)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
112 ("-bd" border-color)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
113 ("-bw" border-width)))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
114
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
115 ;; Handler for switches of the form "-switch value" or "-switch".
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
116 (defun x-handle-switch (switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
117 (let ((aelt (assoc switch x-switch-definitions)))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
118 (if aelt
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
119 (if (nth 2 aelt)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
120 (setq x-switches-specified
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
121 (cons (cons (nth 1 aelt) (nth 2 aelt))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
122 x-switches-specified))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
123 (setq x-switches-specified
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
124 (cons (cons (nth 1 aelt)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
125 (car x-invocation-args))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
126 x-switches-specified)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
127 x-invocation-args (cdr x-invocation-args))))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
128
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
129 ;; Handler for switches of the form "-switch n"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
130 (defun x-handle-numeric-switch (switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
131 (let ((aelt (assoc switch x-switch-definitions)))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
132 (if aelt
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
133 (setq x-switches-specified
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
134 (cons (cons (nth 1 aelt)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
135 (string-to-int (car x-invocation-args)))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
136 x-switches-specified)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
137 x-invocation-args
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
138 (cdr x-invocation-args)))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
139
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
140 ;; Handle the geometry option
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
141 (defun x-handle-geometry (switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
142 (setq x-switches-specified (append x-switches-specified
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
143 (x-geometry (car x-invocation-args)))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
144 x-invocation-args (cdr x-invocation-args)))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
145
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
146 ;; The daemon stuff isn't really useful at the moment.
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
147 (defvar x-daemon-mode nil
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
148 "When set, means initially create just a minibuffer.")
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
149
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
150 (defun x-establish-daemon-mode (switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
151 (setq x-daemon-mode t))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
152
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
153 (defvar x-display-name nil
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
154 "The X display name specifying server and X screen.")
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
155
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
156 (defun x-handle-display (switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
157 (setq x-display-name (car x-invocation-args)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
158 x-invocation-args (cdr x-invocation-args)))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
159
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
160 ;; Here the X-related command line options are processed, before the user's
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
161 ;; startup file is loaded. These are present in ARGS (see startup.el).
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
162 ;; They are copied to x-invocation args from which the X-related things
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
163 ;; are extracted, first the switch (e.g., "-fg") in the following code,
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
164 ;; and possible values (e.g., "black") in the option handler code
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
165 ;; (e.g., x-handle-switch).
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
166
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
167 ;; When finished, only things not pertaining to X (e.g., "-q", filenames)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
168 ;; are left in ARGS
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
169
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
170 (defvar x-invocation-args nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
171
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
172 (if (eq window-system 'x)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
173 (progn
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
174 (setq window-setup-hook 'x-pop-initial-window
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
175 x-invocation-args args
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
176 args nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
177 (require 'x-mouse)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
178 (require 'screen)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
179 (setq suspend-hook
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
180 '(lambda ()
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
181 (error "Suspending an emacs running under X makes no sense")))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
182 (define-key global-map "" 'iconify-emacs)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
183 (while x-invocation-args
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
184 (let* ((this-switch (car x-invocation-args))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
185 (aelt (assoc this-switch command-switch-alist)))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
186 (setq x-invocation-args (cdr x-invocation-args))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
187 (if aelt
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
188 (funcall (cdr aelt) this-switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
189 (setq args (cons this-switch args)))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
190 (setq args (nreverse args))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
191 (x-open-connection (or x-display-name
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
192 (setq x-display-name (getenv "DISPLAY"))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
193 ;;
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
194 ;; This is the place to handle Xresources
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
195 ;;
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
196 )
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
197 (error "Loading x-win.el but not compiled for X"))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
198
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
199
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
200 ;; This is the function which creates the first X window. It is called
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
201 ;; from startup.el after the user's init file is processed.
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
202
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
203 (defun x-pop-initial-window ()
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
204 ;; xterm.c depends on using interrupt-driven input.
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
205 (set-input-mode t nil t)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
206 (setq mouse-motion-handler 'x-track-pointer)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
207 (setq x-switches-specified (append x-switches-specified
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
208 initial-screen-alist
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
209 screen-default-alist))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
210 ;; see screen.el for this function
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
211 (pop-initial-screen x-switches-specified)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
212 (delete-screen terminal-screen))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
213
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
214
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
215 ;;
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
216 ;; Standard X cursor shapes, courtesy of Mr. Fox, who wanted ALL of them.
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
217 ;;
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
218
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
219 (defconst x-pointer-X-cursor 0)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
220 (defconst x-pointer-arrow 2)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
221 (defconst x-pointer-based-arrow-down 4)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
222 (defconst x-pointer-based-arrow-up 6)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
223 (defconst x-pointer-boat 8)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
224 (defconst x-pointer-bogosity 10)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
225 (defconst x-pointer-bottom-left-corner 12)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
226 (defconst x-pointer-bottom-right-corner 14)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
227 (defconst x-pointer-bottom-side 16)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
228 (defconst x-pointer-bottom-tee 18)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
229 (defconst x-pointer-box-spiral 20)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
230 (defconst x-pointer-center-ptr 22)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
231 (defconst x-pointer-circle 24)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
232 (defconst x-pointer-clock 26)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
233 (defconst x-pointer-coffee-mug 28)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
234 (defconst x-pointer-cross 30)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
235 (defconst x-pointer-cross-reverse 32)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
236 (defconst x-pointer-crosshair 34)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
237 (defconst x-pointer-diamond-cross 36)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
238 (defconst x-pointer-dot 38)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
239 (defconst x-pointer-dotbox 40)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
240 (defconst x-pointer-double-arrow 42)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
241 (defconst x-pointer-draft-large 44)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
242 (defconst x-pointer-draft-small 46)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
243 (defconst x-pointer-draped-box 48)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
244 (defconst x-pointer-exchange 50)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
245 (defconst x-pointer-fleur 52)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
246 (defconst x-pointer-gobbler 54)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
247 (defconst x-pointer-gumby 56)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
248 (defconst x-pointer-hand1 58)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
249 (defconst x-pointer-hand2 60)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
250 (defconst x-pointer-heart 62)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
251 (defconst x-pointer-icon 64)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
252 (defconst x-pointer-iron-cross 66)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
253 (defconst x-pointer-left-ptr 68)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
254 (defconst x-pointer-left-side 70)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
255 (defconst x-pointer-left-tee 72)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
256 (defconst x-pointer-leftbutton 74)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
257 (defconst x-pointer-ll-angle 76)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
258 (defconst x-pointer-lr-angle 78)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
259 (defconst x-pointer-man 80)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
260 (defconst x-pointer-middlebutton 82)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
261 (defconst x-pointer-mouse 84)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
262 (defconst x-pointer-pencil 86)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
263 (defconst x-pointer-pirate 88)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
264 (defconst x-pointer-plus 90)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
265 (defconst x-pointer-question-arrow 92)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
266 (defconst x-pointer-right-ptr 94)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
267 (defconst x-pointer-right-side 96)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
268 (defconst x-pointer-right-tee 98)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
269 (defconst x-pointer-rightbutton 100)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
270 (defconst x-pointer-rtl-logo 102)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
271 (defconst x-pointer-sailboat 104)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
272 (defconst x-pointer-sb-down-arrow 106)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
273 (defconst x-pointer-sb-h-double-arrow 108)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
274 (defconst x-pointer-sb-left-arrow 110)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
275 (defconst x-pointer-sb-right-arrow 112)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
276 (defconst x-pointer-sb-up-arrow 114)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
277 (defconst x-pointer-sb-v-double-arrow 116)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
278 (defconst x-pointer-shuttle 118)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
279 (defconst x-pointer-sizing 120)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
280 (defconst x-pointer-spider 122)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
281 (defconst x-pointer-spraycan 124)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
282 (defconst x-pointer-star 126)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
283 (defconst x-pointer-target 128)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
284 (defconst x-pointer-tcross 130)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
285 (defconst x-pointer-top-left-arrow 132)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
286 (defconst x-pointer-top-left-corner 134)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
287 (defconst x-pointer-top-right-corner 136)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
288 (defconst x-pointer-top-side 138)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
289 (defconst x-pointer-top-tee 140)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
290 (defconst x-pointer-trek 142)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
291 (defconst x-pointer-ul-angle 144)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
292 (defconst x-pointer-umbrella 146)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
293 (defconst x-pointer-ur-angle 148)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
294 (defconst x-pointer-watch 150)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
295 (defconst x-pointer-xterm 152)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
296
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
297 ;;
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
298 ;; Available colors
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
299 ;;
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
300
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
301 (defvar x-colors '("aquamarine"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
302 "Aquamarine"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
303 "medium aquamarine"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
304 "MediumAquamarine"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
305 "black"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
306 "Black"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
307 "blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
308 "Blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
309 "cadet blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
310 "CadetBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
311 "cornflower blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
312 "CornflowerBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
313 "dark slate blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
314 "DarkSlateBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
315 "light blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
316 "LightBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
317 "light steel blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
318 "LightSteelBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
319 "medium blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
320 "MediumBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
321 "medium slate blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
322 "MediumSlateBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
323 "midnight blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
324 "MidnightBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
325 "navy blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
326 "NavyBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
327 "navy"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
328 "Navy"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
329 "sky blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
330 "SkyBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
331 "slate blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
332 "SlateBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
333 "steel blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
334 "SteelBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
335 "coral"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
336 "Coral"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
337 "cyan"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
338 "Cyan"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
339 "firebrick"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
340 "Firebrick"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
341 "brown"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
342 "Brown"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
343 "gold"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
344 "Gold"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
345 "goldenrod"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
346 "Goldenrod"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
347 "medium goldenrod"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
348 "MediumGoldenrod"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
349 "green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
350 "Green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
351 "dark green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
352 "DarkGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
353 "dark olive green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
354 "DarkOliveGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
355 "forest green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
356 "ForestGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
357 "lime green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
358 "LimeGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
359 "medium forest green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
360 "MediumForestGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
361 "medium sea green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
362 "MediumSeaGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
363 "medium spring green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
364 "MediumSpringGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
365 "pale green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
366 "PaleGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
367 "sea green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
368 "SeaGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
369 "spring green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
370 "SpringGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
371 "yellow green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
372 "YellowGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
373 "dark slate grey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
374 "DarkSlateGrey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
375 "dark slate gray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
376 "DarkSlateGray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
377 "dim grey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
378 "DimGrey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
379 "dim gray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
380 "DimGray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
381 "light grey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
382 "LightGrey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
383 "light gray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
384 "LightGray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
385 "gray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
386 "grey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
387 "Gray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
388 "Grey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
389 "khaki"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
390 "Khaki"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
391 "magenta"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
392 "Magenta"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
393 "maroon"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
394 "Maroon"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
395 "orange"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
396 "Orange"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
397 "orchid"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
398 "Orchid"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
399 "dark orchid"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
400 "DarkOrchid"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
401 "medium orchid"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
402 "MediumOrchid"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
403 "pink"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
404 "Pink"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
405 "plum"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
406 "Plum"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
407 "red"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
408 "Red"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
409 "indian red"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
410 "IndianRed"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
411 "medium violet red"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
412 "MediumVioletRed"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
413 "orange red"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
414 "OrangeRed"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
415 "violet red"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
416 "VioletRed"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
417 "salmon"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
418 "Salmon"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
419 "sienna"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
420 "Sienna"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
421 "tan"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
422 "Tan"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
423 "thistle"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
424 "Thistle"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
425 "turquoise"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
426 "Turquoise"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
427 "dark turquoise"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
428 "DarkTurquoise"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
429 "medium turquoise"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
430 "MediumTurquoise"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
431 "violet"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
432 "Violet"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
433 "blue violet"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
434 "BlueViolet"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
435 "wheat"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
436 "Wheat"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
437 "white"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
438 "White"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
439 "yellow"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
440 "Yellow"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
441 "green yellow"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
442 "GreenYellow")
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
443 "The full list of X colors from the rgb.text file.")
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
444
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
445 (defun x-defined-colors ()
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
446 "Return a list of colors supported by the current X-Display."
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
447 (let ((all-colors x-colors)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
448 (this-color nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
449 (defined-colors nil))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
450 (while all-colors
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
451 (setq this-color (car all-colors)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
452 all-colors (cdr all-colors))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
453 (and (x-defined-color this-color)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
454 (setq defined-colors (cons this-color defined-colors))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
455 defined-colors))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
456
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
457
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
458 ;;
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
459 ;; Convenience functions for dynamically changing screen parameters
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
460 ;;
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
461
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
462 (defun x-set-default-font (font-name)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
463 (interactive "sFont name: ")
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
464 (modify-screen-parameters (selected-screen)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
465 (list (cons 'font font-name))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
466
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
467 (defun x-set-background (color-name)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
468 (interactive "sColor: ")
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
469 (modify-screen-parameters (selected-screen)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
470 (list (cons 'background-color color-name))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
471
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
472 (defun x-set-foreground (color-name)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
473 (interactive "sColor: ")
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
474 (modify-screen-parameters (selected-screen)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
475 (list (cons 'foreground-color color-name))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
476
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
477 (defun x-set-cursor (color-name)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
478 (interactive "sColor: ")
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
479 (modify-screen-parameters (selected-screen)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
480 (list (cons 'cursor-color color-name))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
481
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
482 (defun x-set-mouse (color-name)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
483 (interactive "sColor: ")
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
484 (modify-screen-parameters (selected-screen)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
485 (list (cons 'mouse-color color-name))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
486
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
487 (defun x-set-mouse-shape (shape)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
488 (interactive "sShape: ")
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
489 (setq x-pointer-shape (eval (intern shape)))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
490 (modify-screen-parameters (selected-screen)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
491 (list (assoc 'mouse-color (screen-parameters)))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
492
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
493 (defun x-set-border (color-name)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
494 (interactive "sColor: ")
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
495 (modify-screen-parameters (selected-screen)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
496 (list (cons 'border-color color-name))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
497
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
498 (defun x-set-name (name)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
499 (interactive "sName: ")
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
500 (modify-screen-parameters (selected-screen)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
501 (list (cons 'name name))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
502
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
503 (defun x-set-auto-raise (toggle)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
504 (interactive "xt or nil? ")
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
505 (modify-screen-parameters (selected-screen)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
506 (list (cons 'auto-raise toggle))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
507
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
508 (defun x-set-auto-lower (toggle)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
509 (interactive "xt or nil? ")
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
510 (modify-screen-parameters (selected-screen)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
511 (list (cons 'auto-lower toggle))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
512
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
513 (defun x-set-vertical-bar (toggle)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
514 (interactive "xt or nil? ")
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
515 (modify-screen-parameters (selected-screen)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
516 (list (cons 'vertical-scroll-bar toggle))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
517
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
518 (defun x-set-horizontal-bar (toggle)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
519 (interactive "xt or nil? ")
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
520 (modify-screen-parameters (selected-screen)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
521 (list (cons 'horizontal-scroll-bar toggle))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
522
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
523 ;;
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
524 ;; Function key processing under X. Function keys are received through
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
525 ;; in the input stream as Lisp symbols.
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
526 ;;
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
527
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
528 (defun define-function-key (map sym definition)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
529 (let ((exist (assq sym (cdr map))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
530 (if exist
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
531 (setcdr exist definition)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
532 (setcdr map
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
533 (cons (cons sym definition)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
534 (cdr map))))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
535
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
536 ;; For unused keysyms. If this happens, it's probably a server or
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
537 ;; Xlib bug.
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
538
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
539 (defun weird-x-keysym ()
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
540 (interactive)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
541 (error "Bizarre X keysym received."))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
542 (define-function-key global-function-map 'xk-not-serious 'weird-x-keysym)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
543
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
544 ;; Keypad type things
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
545
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
546 (define-function-key global-function-map 'xk-home 'beginning-of-line)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
547 (define-function-key global-function-map 'xk-left 'backward-char)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
548 (define-function-key global-function-map 'xk-up 'previous-line)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
549 (define-function-key global-function-map 'xk-right 'forward-char)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
550 (define-function-key global-function-map 'xk-down 'next-line)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
551 (define-function-key global-function-map 'xk-prior 'previous-line)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
552 (define-function-key global-function-map 'xk-next 'next-line)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
553 (define-function-key global-function-map 'xk-end 'end-of-line)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
554 (define-function-key global-function-map 'xk-begin 'beginning-of-line)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
555
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
556 ;; IsMiscFunctionKey
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
557
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
558 (define-function-key global-function-map 'xk-select nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
559 (define-function-key global-function-map 'xk-print nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
560 (define-function-key global-function-map 'xk-execute nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
561 (define-function-key global-function-map 'xk-insert nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
562 (define-function-key global-function-map 'xk-undo nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
563 (define-function-key global-function-map 'xk-redo nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
564 (define-function-key global-function-map 'xk-menu nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
565 (define-function-key global-function-map 'xk-find nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
566 (define-function-key global-function-map 'xk-cancel nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
567 (define-function-key global-function-map 'xk-help nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
568 (define-function-key global-function-map 'xk-break nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
569
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
570 ;; IsKeypadKey
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
571
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
572 (define-function-key global-function-map 'xk-kp-space
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
573 '(lambda nil (interactive)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
574 (insert " ")))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
575 (define-function-key global-function-map 'xk-kp-tab
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
576 '(lambda nil (interactive)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
577 (insert "\t")))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
578 (define-function-key global-function-map 'xk-kp-enter
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
579 '(lambda nil (interactive)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
580 (insert "\n")))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
581
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
582 (define-function-key global-function-map 'xk-kp-f1 'rmail)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
583 (define-function-key global-function-map 'xk-kp-f2 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
584 (define-function-key global-function-map 'xk-kp-f3 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
585 (define-function-key global-function-map 'xk-kp-f4 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
586
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
587 (define-function-key global-function-map 'xk-kp-equal
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
588 '(lambda nil (interactive)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
589 (insert "=")))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
590 (define-function-key global-function-map 'xk-kp-multiply
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
591 '(lambda nil (interactive)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
592 (insert "*")))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
593 (define-function-key global-function-map 'xk-kp-add
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
594 '(lambda nil (interactive)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
595 (insert "+")))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
596 (define-function-key global-function-map 'xk-kp-separator
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
597 '(lambda nil (interactive)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
598 (insert ";")))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
599 (define-function-key global-function-map 'xk-kp-subtract
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
600 '(lambda nil (interactive)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
601 (insert "-")))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
602 (define-function-key global-function-map 'xk-kp-decimal
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
603 '(lambda nil (interactive)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
604 (insert ".")))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
605 (define-function-key global-function-map 'xk-kp-divide
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
606 '(lambda nil (interactive)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
607 (insert "/")))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
608
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
609 (define-function-key global-function-map 'xk-kp-0
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
610 '(lambda nil (interactive)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
611 (insert "0")))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
612 (define-function-key global-function-map 'xk-kp-1
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
613 '(lambda nil (interactive)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
614 (insert "1")))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
615 (define-function-key global-function-map 'xk-kp-2
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
616 '(lambda nil (interactive)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
617 (insert "2")))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
618 (define-function-key global-function-map 'xk-kp-3
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
619 '(lambda nil (interactive)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
620 (insert "3")))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
621 (define-function-key global-function-map 'xk-kp-4
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
622 '(lambda nil (interactive)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
623 (insert "4")))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
624 (define-function-key global-function-map 'xk-kp-5
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
625 '(lambda nil (interactive)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
626 (insert "5")))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
627 (define-function-key global-function-map 'xk-kp-6
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
628 '(lambda nil (interactive)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
629 (insert "6")))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
630 (define-function-key global-function-map 'xk-kp-7
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
631 '(lambda nil (interactive)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
632 (insert "7")))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
633 (define-function-key global-function-map 'xk-kp-8
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
634 '(lambda nil (interactive)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
635 (insert "8")))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
636 (define-function-key global-function-map 'xk-kp-9
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
637 '(lambda nil (interactive)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
638 (insert "9")))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
639
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
640 ;; IsFunctionKey
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
641
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
642 (define-function-key global-function-map 'xk-f1 'rmail)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
643 (define-function-key global-function-map 'xk-f2 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
644 (define-function-key global-function-map 'xk-f3 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
645 (define-function-key global-function-map 'xk-f4 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
646 (define-function-key global-function-map 'xk-f5 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
647 (define-function-key global-function-map 'xk-f6 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
648 (define-function-key global-function-map 'xk-f7 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
649 (define-function-key global-function-map 'xk-f8 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
650 (define-function-key global-function-map 'xk-f9 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
651 (define-function-key global-function-map 'xk-f10 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
652 (define-function-key global-function-map 'xk-f11 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
653 (define-function-key global-function-map 'xk-f12 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
654 (define-function-key global-function-map 'xk-f13 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
655 (define-function-key global-function-map 'xk-f14 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
656 (define-function-key global-function-map 'xk-f15 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
657 (define-function-key global-function-map 'xk-f16 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
658 (define-function-key global-function-map 'xk-f17 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
659 (define-function-key global-function-map 'xk-f18 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
660 (define-function-key global-function-map 'xk-f19 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
661 (define-function-key global-function-map 'xk-f20 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
662 (define-function-key global-function-map 'xk-f21 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
663 (define-function-key global-function-map 'xk-f22 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
664 (define-function-key global-function-map 'xk-f23 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
665 (define-function-key global-function-map 'xk-f24 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
666 (define-function-key global-function-map 'xk-f25 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
667 (define-function-key global-function-map 'xk-f26 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
668 (define-function-key global-function-map 'xk-f27 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
669 (define-function-key global-function-map 'xk-f28 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
670 (define-function-key global-function-map 'xk-f29 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
671 (define-function-key global-function-map 'xk-f30 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
672 (define-function-key global-function-map 'xk-f31 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
673 (define-function-key global-function-map 'xk-f32 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
674 (define-function-key global-function-map 'xk-f33 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
675 (define-function-key global-function-map 'xk-f34 nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
676 (define-function-key global-function-map 'xk-f35 nil)