annotate lisp/term/x-win.el @ 3042:793f7e0dc66b

(modify_event_symbol): If a name_table elt is null, generate a name to use. Don't crash.
author Richard M. Stallman <rms@gnu.org>
date Mon, 24 May 1993 22:58:54 +0000
parents 98f500ca5593
children 32c1cb0149b3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2157
0d77768bf3f2 Added library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2145
diff changeset
1 ;;; x-win.el --- parse switches controlling interface with X window system
0d77768bf3f2 Added library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2145
diff changeset
2
0d77768bf3f2 Added library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2145
diff changeset
3 ;; Author: FSF
0d77768bf3f2 Added library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2145
diff changeset
4 ;; Keywords: terminals
0d77768bf3f2 Added library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2145
diff changeset
5
2366
ed9b74c46fb9 * x-win.el: Update copyright to 1993.
Jim Blandy <jimb@redhat.com>
parents: 2157
diff changeset
6 ;; Copyright (C) 1993 Free Software Foundation, Inc.
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10 ;; GNU Emacs is distributed in the hope that it will be useful,
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11 ;; but WITHOUT ANY WARRANTY. No author or distributor
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12 ;; accepts responsibility to anyone for the consequences of using it
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 ;; or for whether it serves any particular purpose or works at all,
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 ;; unless he says so in writing. Refer to the GNU Emacs General Public
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15 ;; License for full details.
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17 ;; Everyone is granted permission to copy, modify and redistribute
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
18 ;; GNU Emacs, but only under the conditions described in the
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
19 ;; GNU Emacs General Public License. A copy of this license is
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20 ;; supposed to have been given to you along with GNU Emacs so you
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
21 ;; can know your rights and responsibilities. It should be in a
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22 ;; file named COPYING. Among other things, the copyright notice
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
23 ;; and this notice must be preserved on all copies.
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
24
2157
0d77768bf3f2 Added library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2145
diff changeset
25 ;;; Commentary:
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
26
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
27 ;; 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
28 ;; 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
29 ;; pertaining to X are processed and removed from the command line. The
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
30 ;; 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
31
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
32 ;; startup.el will then examine startup files, and eventually call the hooks
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
33 ;; which create the first window (s).
2157
0d77768bf3f2 Added library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2145
diff changeset
34
0d77768bf3f2 Added library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2145
diff changeset
35 ;;; Code:
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
36
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
37 ;; These are the standard X switches from the Xt Initialize.c file of
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
38 ;; Release 4.
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
39
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40 ;; Command line Resource Manager string
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42 ;; +rv *reverseVideo
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43 ;; +synchronous *synchronous
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
44 ;; -background *background
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
45 ;; -bd *borderColor
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
46 ;; -bg *background
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
47 ;; -bordercolor *borderColor
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
48 ;; -borderwidth .borderWidth
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
49 ;; -bw .borderWidth
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
50 ;; -display .display
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
51 ;; -fg *foreground
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
52 ;; -fn *font
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
53 ;; -font *font
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
54 ;; -foreground *foreground
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
55 ;; -geometry .geometry
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
56 ;; -iconic .iconic
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
57 ;; -name .name
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
58 ;; -reverse *reverseVideo
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
59 ;; -rv *reverseVideo
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
60 ;; -selectionTimeout .selectionTimeout
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
61 ;; -synchronous *synchronous
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
62 ;; -xrm
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
63
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
64 ;; An alist of X options and the function which handles them. See
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
65 ;; ../startup.el.
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
66
273
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
67 (if (not (eq window-system 'x))
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
68 (error "Loading x-win.el but not compiled for X"))
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
69
779
c2dbf1fe0506 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
70 (require 'frame)
467
95e458d30014 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 396
diff changeset
71 (require 'mouse)
1972
b0cde2f5164d * term/x-win.el: Require `scroll-bar', not `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1954
diff changeset
72 (require 'scroll-bar)
2718
c91b18333f58 * x-win.el: Since we require faces.el, there's no point in setting
Jim Blandy <jimb@redhat.com>
parents: 2586
diff changeset
73 (require 'faces)
c91b18333f58 * x-win.el: Since we require faces.el, there's no point in setting
Jim Blandy <jimb@redhat.com>
parents: 2586
diff changeset
74 (require 'select)
2808
b809a8da05cb Require menu-bar.el.
Richard M. Stallman <rms@gnu.org>
parents: 2718
diff changeset
75 (require 'menu-bar)
273
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
76
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
77 (setq command-switch-alist
380
2ee195986980 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 378
diff changeset
78 (append '(("-bw" . x-handle-numeric-switch)
273
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
79 ("-d" . x-handle-display)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
80 ("-display" . x-handle-display)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
81 ("-name" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
82 ("-T" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
83 ("-r" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
84 ("-rv" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
85 ("-reverse" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
86 ("-fn" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
87 ("-font" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
88 ("-ib" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
89 ("-g" . x-handle-geometry)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
90 ("-geometry" . x-handle-geometry)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
91 ("-fg" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
92 ("-foreground". x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
93 ("-bg" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
94 ("-background". x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
95 ("-ms" . x-handle-switch)
1547
2754d53edf5d (command-switch-alist, x-switch-definitions):
Richard M. Stallman <rms@gnu.org>
parents: 1546
diff changeset
96 ("-itype" . x-handle-switch)
273
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
97 ("-iconic" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
98 ("-cr" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
99 ("-vb" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
100 ("-hb" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
101 ("-bd" . x-handle-switch))
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
102 command-switch-alist))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
103
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
104 (defconst x-switch-definitions
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
105 '(("-name" name)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
106 ("-T" name)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
107 ("-r" lose)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
108 ("-rv" lose)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
109 ("-reverse" lose)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
110 ("-fn" font)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
111 ("-font" font)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
112 ("-ib" internal-border-width)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
113 ("-fg" foreground-color)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
114 ("-foreground" foreground-color)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
115 ("-bg" background-color)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
116 ("-background" background-color)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
117 ("-ms" mouse-color)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
118 ("-cr" cursor-color)
1547
2754d53edf5d (command-switch-alist, x-switch-definitions):
Richard M. Stallman <rms@gnu.org>
parents: 1546
diff changeset
119 ("-itype" icon-type t)
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
120 ("-iconic" iconic-startup t)
1984
e0c7208bdafa * term/x-win.el (x-switch-definitons): Use the proper names for
Jim Blandy <jimb@redhat.com>
parents: 1972
diff changeset
121 ("-vb" vertical-scroll-bars t)
e0c7208bdafa * term/x-win.el (x-switch-definitons): Use the proper names for
Jim Blandy <jimb@redhat.com>
parents: 1972
diff changeset
122 ("-hb" horizontal-scroll-bars t)
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
123 ("-bd" border-color)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
124 ("-bw" border-width)))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
125
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
126 ;; Handler for switches of the form "-switch value" or "-switch".
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
127 (defun x-handle-switch (switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
128 (let ((aelt (assoc switch x-switch-definitions)))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
129 (if aelt
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
130 (if (nth 2 aelt)
779
c2dbf1fe0506 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
131 (setq default-frame-alist
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
132 (cons (cons (nth 1 aelt) (nth 2 aelt))
779
c2dbf1fe0506 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
133 default-frame-alist))
c2dbf1fe0506 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
134 (setq default-frame-alist
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
135 (cons (cons (nth 1 aelt)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
136 (car x-invocation-args))
779
c2dbf1fe0506 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
137 default-frame-alist)
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
138 x-invocation-args (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 ;; Handler for switches of the form "-switch n"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
141 (defun x-handle-numeric-switch (switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
142 (let ((aelt (assoc switch x-switch-definitions)))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
143 (if aelt
779
c2dbf1fe0506 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
144 (setq default-frame-alist
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
145 (cons (cons (nth 1 aelt)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
146 (string-to-int (car x-invocation-args)))
779
c2dbf1fe0506 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
147 default-frame-alist)
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
148 x-invocation-args
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
149 (cdr x-invocation-args)))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
150
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
151 ;; Handle the geometry option
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
152 (defun x-handle-geometry (switch)
2367
df7de9403e02 * x-win.el (x-defined-colors): Use x-color-defined-p instead of
Jim Blandy <jimb@redhat.com>
parents: 2366
diff changeset
153 (setq initial-frame-alist
df7de9403e02 * x-win.el (x-defined-colors): Use x-color-defined-p instead of
Jim Blandy <jimb@redhat.com>
parents: 2366
diff changeset
154 (append initial-frame-alist
df7de9403e02 * x-win.el (x-defined-colors): Use x-color-defined-p instead of
Jim Blandy <jimb@redhat.com>
parents: 2366
diff changeset
155 (x-parse-geometry (car x-invocation-args)))
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
156 x-invocation-args (cdr x-invocation-args)))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
157
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
158 (defvar x-display-name nil
779
c2dbf1fe0506 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
159 "The X display name specifying server and X frame.")
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
160
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
161 (defun x-handle-display (switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
162 (setq x-display-name (car x-invocation-args)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
163 x-invocation-args (cdr x-invocation-args)))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
164
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
165 (defvar x-invocation-args nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
166
321
4f8a6ec23155 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 303
diff changeset
167 (defun x-handle-args (args)
4f8a6ec23155 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 303
diff changeset
168 "Here the X-related command line options in ARGS are processed,
4f8a6ec23155 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 303
diff changeset
169 before the user's startup file is loaded. They are copied to
4f8a6ec23155 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 303
diff changeset
170 x-invocation args from which the X-related things are extracted, first
4f8a6ec23155 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 303
diff changeset
171 the switch (e.g., \"-fg\") in the following code, and possible values
4f8a6ec23155 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 303
diff changeset
172 (e.g., \"black\") in the option handler code (e.g., x-handle-switch).
4f8a6ec23155 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 303
diff changeset
173 This returns ARGS with the arguments that have been processed removed."
273
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
174 (setq x-invocation-args args
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
175 args nil)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
176 (while x-invocation-args
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
177 (let* ((this-switch (car x-invocation-args))
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
178 (aelt (assoc this-switch command-switch-alist)))
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
179 (setq x-invocation-args (cdr x-invocation-args))
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
180 (if aelt
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
181 (funcall (cdr aelt) this-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
182 (setq args (cons this-switch args)))))
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
183 (setq args (nreverse args)))
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
184
279
481ba9350304 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 273
diff changeset
185
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
186
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
187 ;;
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
188 ;; Standard X cursor shapes, courtesy of Mr. Fox, who wanted ALL of them.
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
189 ;;
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
190
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
191 (defconst x-pointer-X-cursor 0)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
192 (defconst x-pointer-arrow 2)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
193 (defconst x-pointer-based-arrow-down 4)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
194 (defconst x-pointer-based-arrow-up 6)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
195 (defconst x-pointer-boat 8)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
196 (defconst x-pointer-bogosity 10)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
197 (defconst x-pointer-bottom-left-corner 12)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
198 (defconst x-pointer-bottom-right-corner 14)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
199 (defconst x-pointer-bottom-side 16)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
200 (defconst x-pointer-bottom-tee 18)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
201 (defconst x-pointer-box-spiral 20)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
202 (defconst x-pointer-center-ptr 22)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
203 (defconst x-pointer-circle 24)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
204 (defconst x-pointer-clock 26)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
205 (defconst x-pointer-coffee-mug 28)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
206 (defconst x-pointer-cross 30)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
207 (defconst x-pointer-cross-reverse 32)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
208 (defconst x-pointer-crosshair 34)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
209 (defconst x-pointer-diamond-cross 36)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
210 (defconst x-pointer-dot 38)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
211 (defconst x-pointer-dotbox 40)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
212 (defconst x-pointer-double-arrow 42)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
213 (defconst x-pointer-draft-large 44)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
214 (defconst x-pointer-draft-small 46)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
215 (defconst x-pointer-draped-box 48)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
216 (defconst x-pointer-exchange 50)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
217 (defconst x-pointer-fleur 52)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
218 (defconst x-pointer-gobbler 54)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
219 (defconst x-pointer-gumby 56)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
220 (defconst x-pointer-hand1 58)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
221 (defconst x-pointer-hand2 60)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
222 (defconst x-pointer-heart 62)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
223 (defconst x-pointer-icon 64)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
224 (defconst x-pointer-iron-cross 66)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
225 (defconst x-pointer-left-ptr 68)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
226 (defconst x-pointer-left-side 70)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
227 (defconst x-pointer-left-tee 72)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
228 (defconst x-pointer-leftbutton 74)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
229 (defconst x-pointer-ll-angle 76)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
230 (defconst x-pointer-lr-angle 78)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
231 (defconst x-pointer-man 80)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
232 (defconst x-pointer-middlebutton 82)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
233 (defconst x-pointer-mouse 84)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
234 (defconst x-pointer-pencil 86)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
235 (defconst x-pointer-pirate 88)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
236 (defconst x-pointer-plus 90)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
237 (defconst x-pointer-question-arrow 92)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
238 (defconst x-pointer-right-ptr 94)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
239 (defconst x-pointer-right-side 96)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
240 (defconst x-pointer-right-tee 98)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
241 (defconst x-pointer-rightbutton 100)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
242 (defconst x-pointer-rtl-logo 102)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
243 (defconst x-pointer-sailboat 104)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
244 (defconst x-pointer-sb-down-arrow 106)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
245 (defconst x-pointer-sb-h-double-arrow 108)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
246 (defconst x-pointer-sb-left-arrow 110)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
247 (defconst x-pointer-sb-right-arrow 112)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
248 (defconst x-pointer-sb-up-arrow 114)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
249 (defconst x-pointer-sb-v-double-arrow 116)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
250 (defconst x-pointer-shuttle 118)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
251 (defconst x-pointer-sizing 120)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
252 (defconst x-pointer-spider 122)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
253 (defconst x-pointer-spraycan 124)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
254 (defconst x-pointer-star 126)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
255 (defconst x-pointer-target 128)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
256 (defconst x-pointer-tcross 130)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
257 (defconst x-pointer-top-left-arrow 132)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
258 (defconst x-pointer-top-left-corner 134)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
259 (defconst x-pointer-top-right-corner 136)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
260 (defconst x-pointer-top-side 138)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
261 (defconst x-pointer-top-tee 140)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
262 (defconst x-pointer-trek 142)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
263 (defconst x-pointer-ul-angle 144)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
264 (defconst x-pointer-umbrella 146)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
265 (defconst x-pointer-ur-angle 148)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
266 (defconst x-pointer-watch 150)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
267 (defconst x-pointer-xterm 152)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
268
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
269 ;;
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
270 ;; Available colors
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
271 ;;
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
272
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
273 (defvar x-colors '("aquamarine"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
274 "Aquamarine"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
275 "medium aquamarine"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
276 "MediumAquamarine"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
277 "black"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
278 "Black"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
279 "blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
280 "Blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
281 "cadet blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
282 "CadetBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
283 "cornflower blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
284 "CornflowerBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
285 "dark slate blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
286 "DarkSlateBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
287 "light blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
288 "LightBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
289 "light steel blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
290 "LightSteelBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
291 "medium blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
292 "MediumBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
293 "medium slate blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
294 "MediumSlateBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
295 "midnight blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
296 "MidnightBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
297 "navy blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
298 "NavyBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
299 "navy"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
300 "Navy"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
301 "sky blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
302 "SkyBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
303 "slate blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
304 "SlateBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
305 "steel blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
306 "SteelBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
307 "coral"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
308 "Coral"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
309 "cyan"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
310 "Cyan"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
311 "firebrick"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
312 "Firebrick"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
313 "brown"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
314 "Brown"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
315 "gold"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
316 "Gold"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
317 "goldenrod"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
318 "Goldenrod"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
319 "medium goldenrod"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
320 "MediumGoldenrod"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
321 "green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
322 "Green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
323 "dark green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
324 "DarkGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
325 "dark olive green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
326 "DarkOliveGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
327 "forest green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
328 "ForestGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
329 "lime green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
330 "LimeGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
331 "medium forest green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
332 "MediumForestGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
333 "medium sea green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
334 "MediumSeaGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
335 "medium spring green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
336 "MediumSpringGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
337 "pale green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
338 "PaleGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
339 "sea green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
340 "SeaGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
341 "spring green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
342 "SpringGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
343 "yellow green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
344 "YellowGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
345 "dark slate grey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
346 "DarkSlateGrey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
347 "dark slate gray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
348 "DarkSlateGray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
349 "dim grey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
350 "DimGrey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
351 "dim gray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
352 "DimGray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
353 "light grey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
354 "LightGrey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
355 "light gray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
356 "LightGray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
357 "gray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
358 "grey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
359 "Gray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
360 "Grey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
361 "khaki"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
362 "Khaki"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
363 "magenta"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
364 "Magenta"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
365 "maroon"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
366 "Maroon"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
367 "orange"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
368 "Orange"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
369 "orchid"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
370 "Orchid"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
371 "dark orchid"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
372 "DarkOrchid"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
373 "medium orchid"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
374 "MediumOrchid"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
375 "pink"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
376 "Pink"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
377 "plum"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
378 "Plum"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
379 "red"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
380 "Red"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
381 "indian red"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
382 "IndianRed"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
383 "medium violet red"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
384 "MediumVioletRed"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
385 "orange red"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
386 "OrangeRed"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
387 "violet red"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
388 "VioletRed"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
389 "salmon"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
390 "Salmon"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
391 "sienna"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
392 "Sienna"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
393 "tan"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
394 "Tan"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
395 "thistle"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
396 "Thistle"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
397 "turquoise"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
398 "Turquoise"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
399 "dark turquoise"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
400 "DarkTurquoise"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
401 "medium turquoise"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
402 "MediumTurquoise"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
403 "violet"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
404 "Violet"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
405 "blue violet"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
406 "BlueViolet"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
407 "wheat"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
408 "Wheat"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
409 "white"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
410 "White"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
411 "yellow"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
412 "Yellow"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
413 "green yellow"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
414 "GreenYellow")
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
415 "The full list of X colors from the rgb.text file.")
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
416
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
417 (defun x-defined-colors ()
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
418 "Return a list of colors supported by the current X-Display."
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
419 (let ((all-colors x-colors)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
420 (this-color nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
421 (defined-colors nil))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
422 (while all-colors
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
423 (setq this-color (car all-colors)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
424 all-colors (cdr all-colors))
2367
df7de9403e02 * x-win.el (x-defined-colors): Use x-color-defined-p instead of
Jim Blandy <jimb@redhat.com>
parents: 2366
diff changeset
425 (and (x-color-defined-p this-color)
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
426 (setq defined-colors (cons this-color defined-colors))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
427 defined-colors))
396
d0eb77a4d8f7 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 385
diff changeset
428
d0eb77a4d8f7 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 385
diff changeset
429 ;;;; Function keys
d0eb77a4d8f7 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 385
diff changeset
430
2586
7fe45a326a98 (global-map): Dyke out the last two event-to-function bindings. These belong
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2563
diff changeset
431 (substitute-key-definition 'suspend-emacs 'iconify-frame global-map)
1546
da9a60e97e72 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1266
diff changeset
432
2145
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
433 ;; Map certain keypad keys into ASCII characters
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
434 ;; that people usually expect.
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
435 (define-key function-key-map [backspace] [127])
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
436 (define-key function-key-map [delete] [127])
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
437 (define-key function-key-map [tab] [?\t])
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
438 (define-key function-key-map [linefeed] [?\n])
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
439 (define-key function-key-map [clear] [11])
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
440 (define-key function-key-map [return] [13])
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
441 (define-key function-key-map [escape] [?\e])
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
442 (define-key function-key-map [M-backspace] [?\M-\d])
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
443 (define-key function-key-map [M-delete] [?\M-\d])
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
444 (define-key function-key-map [M-tab] [?\M-\t])
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
445 (define-key function-key-map [M-linefeed] [?\M-\n])
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
446 (define-key function-key-map [M-clear] [?\M-\013])
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
447 (define-key function-key-map [M-return] [?\M-\015])
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
448 (define-key function-key-map [M-escape] [?\M-\e])
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
449
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
450 ;; These tell read-char how to convert
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
451 ;; these special chars to ASCII.
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
452 (put 'backspace 'ascii-character 127)
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
453 (put 'delete 'ascii-character 127)
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
454 (put 'tab 'ascii-character ?\t)
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
455 (put 'linefeed 'ascii-character ?\n)
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
456 (put 'clear 'ascii-character 12)
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
457 (put 'return 'ascii-character 13)
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
458 (put 'escape 'ascii-character ?\e)
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
459
1546
da9a60e97e72 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1266
diff changeset
460 ;;;; Selections and cut buffers
707
e4253da532fb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 643
diff changeset
461
727
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 707
diff changeset
462 ;;; We keep track of the last text selected here, so we can check the
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 707
diff changeset
463 ;;; current selection against it, and avoid passing back our own text
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 707
diff changeset
464 ;;; from x-cut-buffer-or-selection-value.
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 707
diff changeset
465 (defvar x-last-selected-text nil)
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 707
diff changeset
466
707
e4253da532fb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 643
diff changeset
467 ;;; Make TEXT, a string, the primary and clipboard X selections.
e4253da532fb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 643
diff changeset
468 ;;; If you are running xclipboard, this means you can effectively
e4253da532fb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 643
diff changeset
469 ;;; have a window on a copy of the kill-ring.
e4253da532fb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 643
diff changeset
470 ;;; Also, set the value of X cut buffer 0, for backward compatibility
1817
5c2bdeb13f68 x-selection-value has been renamed to x-selection.
Jim Blandy <jimb@redhat.com>
parents: 1772
diff changeset
471 ;;; with older X applications.
3036
98f500ca5593 (x-select-text): New arg PUSH.
Richard M. Stallman <rms@gnu.org>
parents: 2808
diff changeset
472 (defun x-select-text (text &optional push)
98f500ca5593 (x-select-text): New arg PUSH.
Richard M. Stallman <rms@gnu.org>
parents: 2808
diff changeset
473 (x-set-cut-buffer text push)
2366
ed9b74c46fb9 * x-win.el: Update copyright to 1993.
Jim Blandy <jimb@redhat.com>
parents: 2157
diff changeset
474 (x-set-selection 'CLIPBOARD text)
ed9b74c46fb9 * x-win.el: Update copyright to 1993.
Jim Blandy <jimb@redhat.com>
parents: 2157
diff changeset
475 (x-set-selection 'PRIMARY text)
727
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 707
diff changeset
476 (setq x-last-selected-text text))
643
9759addc5671 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 506
diff changeset
477
707
e4253da532fb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 643
diff changeset
478 ;;; Return the value of the current X selection. For compatibility
e4253da532fb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 643
diff changeset
479 ;;; with older X applications, this checks cut buffer 0 before
e4253da532fb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 643
diff changeset
480 ;;; retrieving the value of the primary selection.
e4253da532fb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 643
diff changeset
481 (defun x-cut-buffer-or-selection-value ()
1266
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
482 (let (text)
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
483
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
484 ;; Consult the cut buffer, then the selection. Treat empty strings
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
485 ;; as if they were unset.
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
486 (setq text (x-get-cut-buffer 0))
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
487 (if (string= text "") (setq text nil))
2366
ed9b74c46fb9 * x-win.el: Update copyright to 1993.
Jim Blandy <jimb@redhat.com>
parents: 2157
diff changeset
488 (or text (setq text (x-get-selection 'PRIMARY)))
1266
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
489 (if (string= text "") (setq text nil))
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
490
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
491 (cond
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
492 ((not text) nil)
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
493 ((eq text x-last-selected-text) nil)
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
494 ((string= text x-last-selected-text)
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
495 ;; Record the newer string, so subsequent calls can use the `eq' test.
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
496 (setq x-last-selected-text text)
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
497 nil)
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
498 (t
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
499 (setq x-last-selected-text text)))))
707
e4253da532fb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 643
diff changeset
500
1546
da9a60e97e72 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1266
diff changeset
501
da9a60e97e72 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1266
diff changeset
502 ;;; Do the actual X Windows setup here; the above code just defines
da9a60e97e72 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1266
diff changeset
503 ;;; functions and variables that we use now.
da9a60e97e72 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1266
diff changeset
504
da9a60e97e72 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1266
diff changeset
505 (setq command-line-args (x-handle-args command-line-args))
da9a60e97e72 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1266
diff changeset
506 (x-open-connection (or x-display-name
da9a60e97e72 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1266
diff changeset
507 (setq x-display-name (getenv "DISPLAY"))))
da9a60e97e72 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1266
diff changeset
508
2718
c91b18333f58 * x-win.el: Since we require faces.el, there's no point in setting
Jim Blandy <jimb@redhat.com>
parents: 2586
diff changeset
509 (setq frame-creation-function 'x-create-frame-with-faces)
2145
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
510
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
511 (defun x-win-suspend-error ()
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
512 (error "Suspending an emacs running under X makes no sense"))
2366
ed9b74c46fb9 * x-win.el: Update copyright to 1993.
Jim Blandy <jimb@redhat.com>
parents: 2157
diff changeset
513 (add-hook 'suspend-hook 'x-win-suspend-error)
ed9b74c46fb9 * x-win.el: Update copyright to 1993.
Jim Blandy <jimb@redhat.com>
parents: 2157
diff changeset
514
707
e4253da532fb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 643
diff changeset
515 ;;; Arrange for the kill and yank functions to set and check the clipboard.
e4253da532fb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 643
diff changeset
516 (setq interprogram-cut-function 'x-select-text)
e4253da532fb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 643
diff changeset
517 (setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
273
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
518
383
4f7094a6b826 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 380
diff changeset
519 ;;; Turn off window-splitting optimization; X is usually fast enough
4f7094a6b826 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 380
diff changeset
520 ;;; that this is only annoying.
4f7094a6b826 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 380
diff changeset
521 (setq split-window-keep-point t)
2157
0d77768bf3f2 Added library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2145
diff changeset
522
0d77768bf3f2 Added library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2145
diff changeset
523 ;;; x-win.el ends here