annotate lisp/term/x-win.el @ 9922:f653d8aac66a

(Fmake_overlay, Foverlay_properties, Foverlay_get, Foverlay_put): Use new overlay substructure. (list_buffers_1): Use PT, not point.
author Karl Heuer <kwzh@gnu.org>
date Tue, 15 Nov 1994 02:02:34 +0000
parents 06061a86c50a
children bb1027a75918
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
7298
4fd40bd394fe Update copyright.
Karl Heuer <kwzh@gnu.org>
parents: 7249
diff changeset
2 ;; Copyright (C) 1993, 1994 Free Software Foundation, Inc.
2157
0d77768bf3f2 Added library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2145
diff changeset
3
0d77768bf3f2 Added library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2145
diff changeset
4 ;; Author: FSF
0d77768bf3f2 Added library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2145
diff changeset
5 ;; Keywords: terminals
0d77768bf3f2 Added library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2145
diff changeset
6
3287
f3c8ed7fcb45 Fix initial comments.
Richard M. Stallman <rms@gnu.org>
parents: 3172
diff changeset
7 ;;; This file is part of GNU Emacs.
f3c8ed7fcb45 Fix initial comments.
Richard M. Stallman <rms@gnu.org>
parents: 3172
diff changeset
8 ;;;
f3c8ed7fcb45 Fix initial comments.
Richard M. Stallman <rms@gnu.org>
parents: 3172
diff changeset
9 ;;; GNU Emacs is free software; you can redistribute it and/or modify
f3c8ed7fcb45 Fix initial comments.
Richard M. Stallman <rms@gnu.org>
parents: 3172
diff changeset
10 ;;; it under the terms of the GNU General Public License as published by
f3c8ed7fcb45 Fix initial comments.
Richard M. Stallman <rms@gnu.org>
parents: 3172
diff changeset
11 ;;; the Free Software Foundation; either version 2, or (at your option)
f3c8ed7fcb45 Fix initial comments.
Richard M. Stallman <rms@gnu.org>
parents: 3172
diff changeset
12 ;;; any later version.
f3c8ed7fcb45 Fix initial comments.
Richard M. Stallman <rms@gnu.org>
parents: 3172
diff changeset
13 ;;;
f3c8ed7fcb45 Fix initial comments.
Richard M. Stallman <rms@gnu.org>
parents: 3172
diff changeset
14 ;;; GNU Emacs is distributed in the hope that it will be useful,
f3c8ed7fcb45 Fix initial comments.
Richard M. Stallman <rms@gnu.org>
parents: 3172
diff changeset
15 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
f3c8ed7fcb45 Fix initial comments.
Richard M. Stallman <rms@gnu.org>
parents: 3172
diff changeset
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f3c8ed7fcb45 Fix initial comments.
Richard M. Stallman <rms@gnu.org>
parents: 3172
diff changeset
17 ;;; GNU General Public License for more details.
f3c8ed7fcb45 Fix initial comments.
Richard M. Stallman <rms@gnu.org>
parents: 3172
diff changeset
18 ;;;
f3c8ed7fcb45 Fix initial comments.
Richard M. Stallman <rms@gnu.org>
parents: 3172
diff changeset
19 ;;; You should have received a copy of the GNU General Public License
f3c8ed7fcb45 Fix initial comments.
Richard M. Stallman <rms@gnu.org>
parents: 3172
diff changeset
20 ;;; along with GNU Emacs; see the file COPYING. If not, write to
f3c8ed7fcb45 Fix initial comments.
Richard M. Stallman <rms@gnu.org>
parents: 3172
diff changeset
21 ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22
2157
0d77768bf3f2 Added library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2145
diff changeset
23 ;;; Commentary:
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
24
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
25 ;; 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
26 ;; 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
27 ;; pertaining to X are processed and removed from the command line. The
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
28 ;; 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
29
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
30 ;; startup.el will then examine startup files, and eventually call the hooks
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
31 ;; which create the first window (s).
2157
0d77768bf3f2 Added library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2145
diff changeset
32
0d77768bf3f2 Added library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2145
diff changeset
33 ;;; Code:
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
34
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
35 ;; These are the standard X switches from the Xt Initialize.c file of
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
36 ;; Release 4.
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
37
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
38 ;; Command line Resource Manager string
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
39
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40 ;; +rv *reverseVideo
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41 ;; +synchronous *synchronous
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42 ;; -background *background
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43 ;; -bd *borderColor
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
44 ;; -bg *background
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
45 ;; -bordercolor *borderColor
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
46 ;; -borderwidth .borderWidth
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
47 ;; -bw .borderWidth
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
48 ;; -display .display
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
49 ;; -fg *foreground
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
50 ;; -fn *font
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
51 ;; -font *font
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
52 ;; -foreground *foreground
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
53 ;; -geometry .geometry
3070
08003ba2ac71 * x-win.el (command-switch-alist, x-switch-definitions): Treat
Jim Blandy <jimb@redhat.com>
parents: 3068
diff changeset
54 ;; -i .iconType
08003ba2ac71 * x-win.el (command-switch-alist, x-switch-definitions): Treat
Jim Blandy <jimb@redhat.com>
parents: 3068
diff changeset
55 ;; -itype .iconType
54
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))
4132
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
68 (error "%s: Loading x-win.el but not compiled for X" (invocation-name)))
273
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
3373
4177a984e5c0 (x-invocation-args): Add defvar.
Richard M. Stallman <rms@gnu.org>
parents: 3287
diff changeset
77 (defvar x-invocation-args)
4177a984e5c0 (x-invocation-args): Add defvar.
Richard M. Stallman <rms@gnu.org>
parents: 3287
diff changeset
78
3081
63c51f1e885b Pass x-command-line-resources to x-open-connection.
Richard M. Stallman <rms@gnu.org>
parents: 3070
diff changeset
79 (defvar x-command-line-resources nil)
63c51f1e885b Pass x-command-line-resources to x-open-connection.
Richard M. Stallman <rms@gnu.org>
parents: 3070
diff changeset
80
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
81 (setq command-switch-alist
380
2ee195986980 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 378
diff changeset
82 (append '(("-bw" . x-handle-numeric-switch)
273
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
83 ("-d" . x-handle-display)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
84 ("-display" . x-handle-display)
4132
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
85 ("-name" . x-handle-name-rn-switch)
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
86 ("-rn" . x-handle-name-rn-switch)
273
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
87 ("-T" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
88 ("-r" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
89 ("-rv" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
90 ("-reverse" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
91 ("-fn" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
92 ("-font" . x-handle-switch)
3889
2eebd5d36093 * term/x-win.el (command-switch-alist): "-ib" takes a numeric
Jim Blandy <jimb@redhat.com>
parents: 3756
diff changeset
93 ("-ib" . x-handle-numeric-switch)
273
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
94 ("-g" . x-handle-geometry)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
95 ("-geometry" . x-handle-geometry)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
96 ("-fg" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
97 ("-foreground". x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
98 ("-bg" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
99 ("-background". x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
100 ("-ms" . x-handle-switch)
1547
2754d53edf5d (command-switch-alist, x-switch-definitions):
Richard M. Stallman <rms@gnu.org>
parents: 1546
diff changeset
101 ("-itype" . x-handle-switch)
3070
08003ba2ac71 * x-win.el (command-switch-alist, x-switch-definitions): Treat
Jim Blandy <jimb@redhat.com>
parents: 3068
diff changeset
102 ("-i" . x-handle-switch)
4306
2e51ffb537a8 (x-handle-iconic): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4280
diff changeset
103 ("-iconic" . x-handle-iconic)
4132
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
104 ("-xrm" . x-handle-xrm-switch)
273
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
105 ("-cr" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
106 ("-vb" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
107 ("-hb" . x-handle-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
108 ("-bd" . x-handle-switch))
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
109 command-switch-alist))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
110
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
111 (defconst x-switch-definitions
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
112 '(("-name" name)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
113 ("-T" name)
3068
32c1cb0149b3 * x-win.el (x-select-text): New arg PUSH.
Jim Blandy <jimb@redhat.com>
parents: 3036
diff changeset
114 ("-r" reverse t)
32c1cb0149b3 * x-win.el (x-select-text): New arg PUSH.
Jim Blandy <jimb@redhat.com>
parents: 3036
diff changeset
115 ("-rv" reverse t)
32c1cb0149b3 * x-win.el (x-select-text): New arg PUSH.
Jim Blandy <jimb@redhat.com>
parents: 3036
diff changeset
116 ("-reverse" reverse t)
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
117 ("-fn" font)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
118 ("-font" font)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
119 ("-ib" internal-border-width)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
120 ("-fg" foreground-color)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
121 ("-foreground" foreground-color)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
122 ("-bg" background-color)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
123 ("-background" background-color)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
124 ("-ms" mouse-color)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
125 ("-cr" cursor-color)
1547
2754d53edf5d (command-switch-alist, x-switch-definitions):
Richard M. Stallman <rms@gnu.org>
parents: 1546
diff changeset
126 ("-itype" icon-type t)
3070
08003ba2ac71 * x-win.el (command-switch-alist, x-switch-definitions): Treat
Jim Blandy <jimb@redhat.com>
parents: 3068
diff changeset
127 ("-i" icon-type t)
1984
e0c7208bdafa * term/x-win.el (x-switch-definitons): Use the proper names for
Jim Blandy <jimb@redhat.com>
parents: 1972
diff changeset
128 ("-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
129 ("-hb" horizontal-scroll-bars t)
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
130 ("-bd" border-color)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
131 ("-bw" border-width)))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
132
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
133 ;; Handler for switches of the form "-switch value" or "-switch".
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
134 (defun x-handle-switch (switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
135 (let ((aelt (assoc switch x-switch-definitions)))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
136 (if aelt
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
137 (if (nth 2 aelt)
779
c2dbf1fe0506 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
138 (setq default-frame-alist
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
139 (cons (cons (nth 1 aelt) (nth 2 aelt))
779
c2dbf1fe0506 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
140 default-frame-alist))
c2dbf1fe0506 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
141 (setq default-frame-alist
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
142 (cons (cons (nth 1 aelt)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
143 (car x-invocation-args))
779
c2dbf1fe0506 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
144 default-frame-alist)
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
145 x-invocation-args (cdr x-invocation-args))))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
146
4306
2e51ffb537a8 (x-handle-iconic): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4280
diff changeset
147 ;; Make -iconic apply only to the initial frame!
2e51ffb537a8 (x-handle-iconic): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4280
diff changeset
148 (defun x-handle-iconic (switch)
2e51ffb537a8 (x-handle-iconic): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4280
diff changeset
149 (setq initial-frame-alist
2e51ffb537a8 (x-handle-iconic): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4280
diff changeset
150 (cons '(visibility . icon) initial-frame-alist)))
2e51ffb537a8 (x-handle-iconic): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4280
diff changeset
151
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
152 ;; Handler for switches of the form "-switch n"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
153 (defun x-handle-numeric-switch (switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
154 (let ((aelt (assoc switch x-switch-definitions)))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
155 (if aelt
779
c2dbf1fe0506 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
156 (setq default-frame-alist
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
157 (cons (cons (nth 1 aelt)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
158 (string-to-int (car x-invocation-args)))
779
c2dbf1fe0506 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
159 default-frame-alist)
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
160 x-invocation-args
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
161 (cdr x-invocation-args)))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
162
4132
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
163 ;; Handle the -xrm option.
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
164 (defun x-handle-xrm-switch (switch)
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
165 (or (consp x-invocation-args)
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
166 (error "%s: missing argument to `%s' option" (invocation-name) switch))
3081
63c51f1e885b Pass x-command-line-resources to x-open-connection.
Richard M. Stallman <rms@gnu.org>
parents: 3070
diff changeset
167 (setq x-command-line-resources (car x-invocation-args))
63c51f1e885b Pass x-command-line-resources to x-open-connection.
Richard M. Stallman <rms@gnu.org>
parents: 3070
diff changeset
168 (setq x-invocation-args (cdr x-invocation-args)))
63c51f1e885b Pass x-command-line-resources to x-open-connection.
Richard M. Stallman <rms@gnu.org>
parents: 3070
diff changeset
169
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
170 ;; Handle the geometry option
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
171 (defun x-handle-geometry (switch)
7249
876b3518fa78 (x-handle-geometry): Specify user-position and
Richard M. Stallman <rms@gnu.org>
parents: 6792
diff changeset
172 (let ((geo (x-parse-geometry (car x-invocation-args))))
876b3518fa78 (x-handle-geometry): Specify user-position and
Richard M. Stallman <rms@gnu.org>
parents: 6792
diff changeset
173 (setq initial-frame-alist
876b3518fa78 (x-handle-geometry): Specify user-position and
Richard M. Stallman <rms@gnu.org>
parents: 6792
diff changeset
174 (append initial-frame-alist
876b3518fa78 (x-handle-geometry): Specify user-position and
Richard M. Stallman <rms@gnu.org>
parents: 6792
diff changeset
175 (if (or (assq 'left geo) (assq 'top geo))
876b3518fa78 (x-handle-geometry): Specify user-position and
Richard M. Stallman <rms@gnu.org>
parents: 6792
diff changeset
176 '((user-position . t)))
876b3518fa78 (x-handle-geometry): Specify user-position and
Richard M. Stallman <rms@gnu.org>
parents: 6792
diff changeset
177 (if (or (assq 'height geo) (assq 'width geo))
876b3518fa78 (x-handle-geometry): Specify user-position and
Richard M. Stallman <rms@gnu.org>
parents: 6792
diff changeset
178 '((user-size . t)))
876b3518fa78 (x-handle-geometry): Specify user-position and
Richard M. Stallman <rms@gnu.org>
parents: 6792
diff changeset
179 geo)
876b3518fa78 (x-handle-geometry): Specify user-position and
Richard M. Stallman <rms@gnu.org>
parents: 6792
diff changeset
180 x-invocation-args (cdr x-invocation-args))))
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
181
4132
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
182 ;; Handle the -name and -rn options. Set the variable x-resource-name
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
183 ;; to the option's operand; if the switch was `-name', set the name of
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
184 ;; the initial frame, too.
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
185 (defun x-handle-name-rn-switch (switch)
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
186 (or (consp x-invocation-args)
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
187 (error "%s: missing argument to `%s' option" (invocation-name) switch))
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
188 (setq x-resource-name (car x-invocation-args)
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
189 x-invocation-args (cdr x-invocation-args))
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
190 (if (string= switch "-name")
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
191 (setq initial-frame-alist (cons (cons 'name x-resource-name)
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
192 initial-frame-alist))))
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
193
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
194 (defvar x-display-name nil
779
c2dbf1fe0506 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
195 "The X display name specifying server and X frame.")
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
196
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
197 (defun x-handle-display (switch)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
198 (setq x-display-name (car x-invocation-args)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
199 x-invocation-args (cdr x-invocation-args)))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
200
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
201 (defvar x-invocation-args nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
202
321
4f8a6ec23155 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 303
diff changeset
203 (defun x-handle-args (args)
6698
b107e54218fe (x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 6399
diff changeset
204 "Process the X-related command line options in ARGS.
b107e54218fe (x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 6399
diff changeset
205 This is done before the user's startup file is loaded. They are copied to
321
4f8a6ec23155 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 303
diff changeset
206 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
207 the switch (e.g., \"-fg\") in the following code, and possible values
7639
67b7d1ea7b2e Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 7298
diff changeset
208 \(e.g., \"black\") in the option handler code (e.g., x-handle-switch).
321
4f8a6ec23155 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 303
diff changeset
209 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
210 (setq x-invocation-args args
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
211 args nil)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
212 (while x-invocation-args
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
213 (let* ((this-switch (car x-invocation-args))
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
214 (aelt (assoc this-switch command-switch-alist)))
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
215 (setq x-invocation-args (cdr x-invocation-args))
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
216 (if aelt
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
217 (funcall (cdr aelt) this-switch)
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
218 (setq args (cons this-switch args)))))
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
219 (setq args (nreverse args)))
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
220
279
481ba9350304 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 273
diff changeset
221
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
222
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
223 ;;
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
224 ;; Standard X cursor shapes, courtesy of Mr. Fox, who wanted ALL of them.
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
225 ;;
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
226
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
227 (defconst x-pointer-X-cursor 0)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
228 (defconst x-pointer-arrow 2)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
229 (defconst x-pointer-based-arrow-down 4)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
230 (defconst x-pointer-based-arrow-up 6)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
231 (defconst x-pointer-boat 8)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
232 (defconst x-pointer-bogosity 10)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
233 (defconst x-pointer-bottom-left-corner 12)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
234 (defconst x-pointer-bottom-right-corner 14)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
235 (defconst x-pointer-bottom-side 16)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
236 (defconst x-pointer-bottom-tee 18)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
237 (defconst x-pointer-box-spiral 20)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
238 (defconst x-pointer-center-ptr 22)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
239 (defconst x-pointer-circle 24)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
240 (defconst x-pointer-clock 26)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
241 (defconst x-pointer-coffee-mug 28)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
242 (defconst x-pointer-cross 30)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
243 (defconst x-pointer-cross-reverse 32)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
244 (defconst x-pointer-crosshair 34)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
245 (defconst x-pointer-diamond-cross 36)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
246 (defconst x-pointer-dot 38)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
247 (defconst x-pointer-dotbox 40)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
248 (defconst x-pointer-double-arrow 42)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
249 (defconst x-pointer-draft-large 44)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
250 (defconst x-pointer-draft-small 46)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
251 (defconst x-pointer-draped-box 48)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
252 (defconst x-pointer-exchange 50)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
253 (defconst x-pointer-fleur 52)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
254 (defconst x-pointer-gobbler 54)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
255 (defconst x-pointer-gumby 56)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
256 (defconst x-pointer-hand1 58)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
257 (defconst x-pointer-hand2 60)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
258 (defconst x-pointer-heart 62)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
259 (defconst x-pointer-icon 64)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
260 (defconst x-pointer-iron-cross 66)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
261 (defconst x-pointer-left-ptr 68)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
262 (defconst x-pointer-left-side 70)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
263 (defconst x-pointer-left-tee 72)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
264 (defconst x-pointer-leftbutton 74)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
265 (defconst x-pointer-ll-angle 76)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
266 (defconst x-pointer-lr-angle 78)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
267 (defconst x-pointer-man 80)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
268 (defconst x-pointer-middlebutton 82)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
269 (defconst x-pointer-mouse 84)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
270 (defconst x-pointer-pencil 86)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
271 (defconst x-pointer-pirate 88)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
272 (defconst x-pointer-plus 90)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
273 (defconst x-pointer-question-arrow 92)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
274 (defconst x-pointer-right-ptr 94)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
275 (defconst x-pointer-right-side 96)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
276 (defconst x-pointer-right-tee 98)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
277 (defconst x-pointer-rightbutton 100)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
278 (defconst x-pointer-rtl-logo 102)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
279 (defconst x-pointer-sailboat 104)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
280 (defconst x-pointer-sb-down-arrow 106)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
281 (defconst x-pointer-sb-h-double-arrow 108)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
282 (defconst x-pointer-sb-left-arrow 110)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
283 (defconst x-pointer-sb-right-arrow 112)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
284 (defconst x-pointer-sb-up-arrow 114)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
285 (defconst x-pointer-sb-v-double-arrow 116)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
286 (defconst x-pointer-shuttle 118)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
287 (defconst x-pointer-sizing 120)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
288 (defconst x-pointer-spider 122)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
289 (defconst x-pointer-spraycan 124)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
290 (defconst x-pointer-star 126)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
291 (defconst x-pointer-target 128)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
292 (defconst x-pointer-tcross 130)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
293 (defconst x-pointer-top-left-arrow 132)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
294 (defconst x-pointer-top-left-corner 134)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
295 (defconst x-pointer-top-right-corner 136)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
296 (defconst x-pointer-top-side 138)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
297 (defconst x-pointer-top-tee 140)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
298 (defconst x-pointer-trek 142)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
299 (defconst x-pointer-ul-angle 144)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
300 (defconst x-pointer-umbrella 146)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
301 (defconst x-pointer-ur-angle 148)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
302 (defconst x-pointer-watch 150)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
303 (defconst x-pointer-xterm 152)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
304
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
305 ;;
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
306 ;; Available colors
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
307 ;;
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
308
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
309 (defvar x-colors '("aquamarine"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
310 "Aquamarine"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
311 "medium aquamarine"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
312 "MediumAquamarine"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
313 "black"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
314 "Black"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
315 "blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
316 "Blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
317 "cadet blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
318 "CadetBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
319 "cornflower blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
320 "CornflowerBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
321 "dark slate blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
322 "DarkSlateBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
323 "light blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
324 "LightBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
325 "light steel blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
326 "LightSteelBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
327 "medium blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
328 "MediumBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
329 "medium slate blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
330 "MediumSlateBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
331 "midnight blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
332 "MidnightBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
333 "navy blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
334 "NavyBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
335 "navy"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
336 "Navy"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
337 "sky blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
338 "SkyBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
339 "slate blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
340 "SlateBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
341 "steel blue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
342 "SteelBlue"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
343 "coral"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
344 "Coral"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
345 "cyan"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
346 "Cyan"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
347 "firebrick"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
348 "Firebrick"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
349 "brown"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
350 "Brown"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
351 "gold"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
352 "Gold"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
353 "goldenrod"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
354 "Goldenrod"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
355 "medium goldenrod"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
356 "MediumGoldenrod"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
357 "green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
358 "Green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
359 "dark green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
360 "DarkGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
361 "dark olive green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
362 "DarkOliveGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
363 "forest green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
364 "ForestGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
365 "lime green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
366 "LimeGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
367 "medium forest green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
368 "MediumForestGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
369 "medium sea green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
370 "MediumSeaGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
371 "medium spring green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
372 "MediumSpringGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
373 "pale green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
374 "PaleGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
375 "sea green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
376 "SeaGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
377 "spring green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
378 "SpringGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
379 "yellow green"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
380 "YellowGreen"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
381 "dark slate grey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
382 "DarkSlateGrey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
383 "dark slate gray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
384 "DarkSlateGray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
385 "dim grey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
386 "DimGrey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
387 "dim gray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
388 "DimGray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
389 "light grey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
390 "LightGrey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
391 "light gray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
392 "LightGray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
393 "gray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
394 "grey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
395 "Gray"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
396 "Grey"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
397 "khaki"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
398 "Khaki"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
399 "magenta"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
400 "Magenta"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
401 "maroon"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
402 "Maroon"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
403 "orange"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
404 "Orange"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
405 "orchid"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
406 "Orchid"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
407 "dark orchid"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
408 "DarkOrchid"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
409 "medium orchid"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
410 "MediumOrchid"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
411 "pink"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
412 "Pink"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
413 "plum"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
414 "Plum"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
415 "red"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
416 "Red"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
417 "indian red"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
418 "IndianRed"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
419 "medium violet red"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
420 "MediumVioletRed"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
421 "orange red"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
422 "OrangeRed"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
423 "violet red"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
424 "VioletRed"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
425 "salmon"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
426 "Salmon"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
427 "sienna"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
428 "Sienna"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
429 "tan"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
430 "Tan"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
431 "thistle"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
432 "Thistle"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
433 "turquoise"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
434 "Turquoise"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
435 "dark turquoise"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
436 "DarkTurquoise"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
437 "medium turquoise"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
438 "MediumTurquoise"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
439 "violet"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
440 "Violet"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
441 "blue violet"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
442 "BlueViolet"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
443 "wheat"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
444 "Wheat"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
445 "white"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
446 "White"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
447 "yellow"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
448 "Yellow"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
449 "green yellow"
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
450 "GreenYellow")
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
451 "The full list of X colors from the rgb.text file.")
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
452
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
453 (defun x-defined-colors ()
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
454 "Return a list of colors supported by the current X-Display."
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
455 (let ((all-colors x-colors)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
456 (this-color nil)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
457 (defined-colors nil))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
458 (while all-colors
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
459 (setq this-color (car all-colors)
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
460 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
461 (and (x-color-defined-p this-color)
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
462 (setq defined-colors (cons this-color defined-colors))))
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
463 defined-colors))
396
d0eb77a4d8f7 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 385
diff changeset
464
d0eb77a4d8f7 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 385
diff changeset
465 ;;;; Function keys
d0eb77a4d8f7 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 385
diff changeset
466
4313
87472f1eb031 (iconify-or-deiconify-frame): New function. Use it for C-z.
Richard M. Stallman <rms@gnu.org>
parents: 4306
diff changeset
467 (defun iconify-or-deiconify-frame ()
87472f1eb031 (iconify-or-deiconify-frame): New function. Use it for C-z.
Richard M. Stallman <rms@gnu.org>
parents: 4306
diff changeset
468 "Iconify the selected frame, or deiconify if it's currently an icon."
87472f1eb031 (iconify-or-deiconify-frame): New function. Use it for C-z.
Richard M. Stallman <rms@gnu.org>
parents: 4306
diff changeset
469 (interactive)
87472f1eb031 (iconify-or-deiconify-frame): New function. Use it for C-z.
Richard M. Stallman <rms@gnu.org>
parents: 4306
diff changeset
470 (if (eq (cdr (assq 'visibility (frame-parameters))) t)
87472f1eb031 (iconify-or-deiconify-frame): New function. Use it for C-z.
Richard M. Stallman <rms@gnu.org>
parents: 4306
diff changeset
471 (iconify-frame)
6141
fefa088fc7f9 (iconify-or-deiconify-frame): Don't make invisible before making visible.
Karl Heuer <kwzh@gnu.org>
parents: 6137
diff changeset
472 (make-frame-visible)))
4313
87472f1eb031 (iconify-or-deiconify-frame): New function. Use it for C-z.
Richard M. Stallman <rms@gnu.org>
parents: 4306
diff changeset
473
87472f1eb031 (iconify-or-deiconify-frame): New function. Use it for C-z.
Richard M. Stallman <rms@gnu.org>
parents: 4306
diff changeset
474 (substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame
87472f1eb031 (iconify-or-deiconify-frame): New function. Use it for C-z.
Richard M. Stallman <rms@gnu.org>
parents: 4306
diff changeset
475 global-map)
1546
da9a60e97e72 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1266
diff changeset
476
2145
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
477 ;; Map certain keypad keys into ASCII characters
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
478 ;; that people usually expect.
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
479 (define-key function-key-map [backspace] [127])
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
480 (define-key function-key-map [delete] [127])
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
481 (define-key function-key-map [tab] [?\t])
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
482 (define-key function-key-map [linefeed] [?\n])
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
483 (define-key function-key-map [clear] [11])
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
484 (define-key function-key-map [return] [13])
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
485 (define-key function-key-map [escape] [?\e])
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
486 (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
487 (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
488 (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
489 (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
490 (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
491 (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
492 (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
493
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
494 ;; These tell read-char how to convert
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
495 ;; these special chars to ASCII.
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
496 (put 'backspace 'ascii-character 127)
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
497 (put 'delete 'ascii-character 127)
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
498 (put 'tab 'ascii-character ?\t)
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
499 (put 'linefeed 'ascii-character ?\n)
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
500 (put 'clear 'ascii-character 12)
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
501 (put 'return 'ascii-character 13)
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
502 (put 'escape 'ascii-character ?\e)
5515
920b55d2057b (vendor-key-syms): Set this variable.
Richard M. Stallman <rms@gnu.org>
parents: 4314
diff changeset
503
5537
899159133053 (vendor-key-syms): Add more HP keysyms and some Sun.
Richard M. Stallman <rms@gnu.org>
parents: 5515
diff changeset
504 ;; Set up to recognize vendor-specific keysyms.
899159133053 (vendor-key-syms): Add more HP keysyms and some Sun.
Richard M. Stallman <rms@gnu.org>
parents: 5515
diff changeset
505 ;; Unless/until there is a real conflict,
899159133053 (vendor-key-syms): Add more HP keysyms and some Sun.
Richard M. Stallman <rms@gnu.org>
parents: 5515
diff changeset
506 ;; we need not try to make this list depend on
899159133053 (vendor-key-syms): Add more HP keysyms and some Sun.
Richard M. Stallman <rms@gnu.org>
parents: 5515
diff changeset
507 ;; the type of X server in use.
6097
adf5b18629c8 (system-key-alist): Renamed from vendor-key-syms.
Richard M. Stallman <rms@gnu.org>
parents: 5546
diff changeset
508 (setq system-key-alist
5515
920b55d2057b (vendor-key-syms): Set this variable.
Richard M. Stallman <rms@gnu.org>
parents: 4314
diff changeset
509 '(
920b55d2057b (vendor-key-syms): Set this variable.
Richard M. Stallman <rms@gnu.org>
parents: 4314
diff changeset
510 ;; These are some HP keys.
5537
899159133053 (vendor-key-syms): Add more HP keysyms and some Sun.
Richard M. Stallman <rms@gnu.org>
parents: 5515
diff changeset
511 ( 168 . mute-acute)
899159133053 (vendor-key-syms): Add more HP keysyms and some Sun.
Richard M. Stallman <rms@gnu.org>
parents: 5515
diff changeset
512 ( 169 . mute-grave)
899159133053 (vendor-key-syms): Add more HP keysyms and some Sun.
Richard M. Stallman <rms@gnu.org>
parents: 5515
diff changeset
513 ( 170 . mute-asciicircum)
899159133053 (vendor-key-syms): Add more HP keysyms and some Sun.
Richard M. Stallman <rms@gnu.org>
parents: 5515
diff changeset
514 ( 171 . mute-diaeresis)
899159133053 (vendor-key-syms): Add more HP keysyms and some Sun.
Richard M. Stallman <rms@gnu.org>
parents: 5515
diff changeset
515 ( 172 . mute-asciitilde)
899159133053 (vendor-key-syms): Add more HP keysyms and some Sun.
Richard M. Stallman <rms@gnu.org>
parents: 5515
diff changeset
516 ( 175 . lira)
899159133053 (vendor-key-syms): Add more HP keysyms and some Sun.
Richard M. Stallman <rms@gnu.org>
parents: 5515
diff changeset
517 ( 190 . guilder)
899159133053 (vendor-key-syms): Add more HP keysyms and some Sun.
Richard M. Stallman <rms@gnu.org>
parents: 5515
diff changeset
518 ( 252 . block)
899159133053 (vendor-key-syms): Add more HP keysyms and some Sun.
Richard M. Stallman <rms@gnu.org>
parents: 5515
diff changeset
519 ( 256 . longminus)
5515
920b55d2057b (vendor-key-syms): Set this variable.
Richard M. Stallman <rms@gnu.org>
parents: 4314
diff changeset
520 (65388 . reset)
920b55d2057b (vendor-key-syms): Set this variable.
Richard M. Stallman <rms@gnu.org>
parents: 4314
diff changeset
521 (65389 . system)
920b55d2057b (vendor-key-syms): Set this variable.
Richard M. Stallman <rms@gnu.org>
parents: 4314
diff changeset
522 (65390 . user)
920b55d2057b (vendor-key-syms): Set this variable.
Richard M. Stallman <rms@gnu.org>
parents: 4314
diff changeset
523 (65391 . clearline)
920b55d2057b (vendor-key-syms): Set this variable.
Richard M. Stallman <rms@gnu.org>
parents: 4314
diff changeset
524 (65392 . insertline)
920b55d2057b (vendor-key-syms): Set this variable.
Richard M. Stallman <rms@gnu.org>
parents: 4314
diff changeset
525 (65393 . deleteline)
920b55d2057b (vendor-key-syms): Set this variable.
Richard M. Stallman <rms@gnu.org>
parents: 4314
diff changeset
526 (65394 . insertchar)
920b55d2057b (vendor-key-syms): Set this variable.
Richard M. Stallman <rms@gnu.org>
parents: 4314
diff changeset
527 (65395 . deletechar)
920b55d2057b (vendor-key-syms): Set this variable.
Richard M. Stallman <rms@gnu.org>
parents: 4314
diff changeset
528 (65396 . backtab)
920b55d2057b (vendor-key-syms): Set this variable.
Richard M. Stallman <rms@gnu.org>
parents: 4314
diff changeset
529 (65397 . kp-backtab)
6195
f5f8e0bcfaaf (system-key-alist): Fix the code value for `remove'.
Richard M. Stallman <rms@gnu.org>
parents: 6141
diff changeset
530 ;; This is used by DEC's X server.
f5f8e0bcfaaf (system-key-alist): Fix the code value for `remove'.
Richard M. Stallman <rms@gnu.org>
parents: 6141
diff changeset
531 (65280 . remove)
5537
899159133053 (vendor-key-syms): Add more HP keysyms and some Sun.
Richard M. Stallman <rms@gnu.org>
parents: 5515
diff changeset
532 ;; These are for Sun.
8769
b7eb229e956b (system-key-alist): Add Sun definition for mute-acute.
Richard M. Stallman <rms@gnu.org>
parents: 8760
diff changeset
533 (392963 . mute-acute)
9430
89e30b86622a (system-key-alist): Add sun versions of
Richard M. Stallman <rms@gnu.org>
parents: 8769
diff changeset
534 (392960 . mute-grave)
89e30b86622a (system-key-alist): Add sun versions of
Richard M. Stallman <rms@gnu.org>
parents: 8769
diff changeset
535 (392964 . mute-diaeresis)
89e30b86622a (system-key-alist): Add sun versions of
Richard M. Stallman <rms@gnu.org>
parents: 8769
diff changeset
536 (392961 . mute-asciicircum)
5537
899159133053 (vendor-key-syms): Add more HP keysyms and some Sun.
Richard M. Stallman <rms@gnu.org>
parents: 5515
diff changeset
537 (392976 . f35)
899159133053 (vendor-key-syms): Add more HP keysyms and some Sun.
Richard M. Stallman <rms@gnu.org>
parents: 5515
diff changeset
538 (392977 . f36)
5546
19618ce9a103 (vendor-key-syms): Fixed typo (extra parens).
Roland McGrath <roland@gnu.org>
parents: 5537
diff changeset
539 (393056 . req)
8319
acca78b72dd6 (system-key-alist): Add Sun-specific X11R6 keysyms.
Richard M. Stallman <rms@gnu.org>
parents: 7639
diff changeset
540 ;; These are for Sun under X11R6
acca78b72dd6 (system-key-alist): Add Sun-specific X11R6 keysyms.
Richard M. Stallman <rms@gnu.org>
parents: 7639
diff changeset
541 (393072 . props)
acca78b72dd6 (system-key-alist): Add Sun-specific X11R6 keysyms.
Richard M. Stallman <rms@gnu.org>
parents: 7639
diff changeset
542 (393073 . front)
acca78b72dd6 (system-key-alist): Add Sun-specific X11R6 keysyms.
Richard M. Stallman <rms@gnu.org>
parents: 7639
diff changeset
543 (393074 . copy)
acca78b72dd6 (system-key-alist): Add Sun-specific X11R6 keysyms.
Richard M. Stallman <rms@gnu.org>
parents: 7639
diff changeset
544 (393075 . open)
acca78b72dd6 (system-key-alist): Add Sun-specific X11R6 keysyms.
Richard M. Stallman <rms@gnu.org>
parents: 7639
diff changeset
545 (393076 . paste)
acca78b72dd6 (system-key-alist): Add Sun-specific X11R6 keysyms.
Richard M. Stallman <rms@gnu.org>
parents: 7639
diff changeset
546 (393077 . cut)
5515
920b55d2057b (vendor-key-syms): Set this variable.
Richard M. Stallman <rms@gnu.org>
parents: 4314
diff changeset
547 ))
54
bacfccb982c9 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
548
1546
da9a60e97e72 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1266
diff changeset
549 ;;;; Selections and cut buffers
707
e4253da532fb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 643
diff changeset
550
727
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 707
diff changeset
551 ;;; 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
552 ;;; current selection against it, and avoid passing back our own text
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 707
diff changeset
553 ;;; from x-cut-buffer-or-selection-value.
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 707
diff changeset
554 (defvar x-last-selected-text nil)
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 707
diff changeset
555
4273
79dc5c3370f8 (x-select-text): Never set the CLIPBOARD selection.
Richard M. Stallman <rms@gnu.org>
parents: 4246
diff changeset
556 ;;; It is said that overlarge strings are slow to put into the cut buffer.
4306
2e51ffb537a8 (x-handle-iconic): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4280
diff changeset
557 ;;; Note this value is overridden below.
2e51ffb537a8 (x-handle-iconic): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4280
diff changeset
558 (defvar x-cut-buffer-max 20000
4273
79dc5c3370f8 (x-select-text): Never set the CLIPBOARD selection.
Richard M. Stallman <rms@gnu.org>
parents: 4246
diff changeset
559 "Max number of characters to put in the cut buffer.")
4236
8e14db210975 (x-select-text): Limit size of text sent to cut buffer.
Richard M. Stallman <rms@gnu.org>
parents: 4132
diff changeset
560
6698
b107e54218fe (x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 6399
diff changeset
561 (defvar x-select-enable-clipboard nil
b107e54218fe (x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 6399
diff changeset
562 "Non-nil means cutting and pasting uses the clipboard.
b107e54218fe (x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 6399
diff changeset
563 This is in addition to the primary selection.")
b107e54218fe (x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 6399
diff changeset
564
4273
79dc5c3370f8 (x-select-text): Never set the CLIPBOARD selection.
Richard M. Stallman <rms@gnu.org>
parents: 4246
diff changeset
565 ;;; Make TEXT, a string, the primary X selection.
707
e4253da532fb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 643
diff changeset
566 ;;; 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
567 ;;; with older X applications.
4273
79dc5c3370f8 (x-select-text): Never set the CLIPBOARD selection.
Richard M. Stallman <rms@gnu.org>
parents: 4246
diff changeset
568 ;;; gildea@lcs.mit.edu says it's not desirable to put kills
79dc5c3370f8 (x-select-text): Never set the CLIPBOARD selection.
Richard M. Stallman <rms@gnu.org>
parents: 4246
diff changeset
569 ;;; in the clipboard.
3036
98f500ca5593 (x-select-text): New arg PUSH.
Richard M. Stallman <rms@gnu.org>
parents: 2808
diff changeset
570 (defun x-select-text (text &optional push)
4236
8e14db210975 (x-select-text): Limit size of text sent to cut buffer.
Richard M. Stallman <rms@gnu.org>
parents: 4132
diff changeset
571 ;; Don't send the cut buffer too much text.
8e14db210975 (x-select-text): Limit size of text sent to cut buffer.
Richard M. Stallman <rms@gnu.org>
parents: 4132
diff changeset
572 ;; It becomes slow, and if really big it causes errors.
8e14db210975 (x-select-text): Limit size of text sent to cut buffer.
Richard M. Stallman <rms@gnu.org>
parents: 4132
diff changeset
573 (if (< (length text) x-cut-buffer-max)
4273
79dc5c3370f8 (x-select-text): Never set the CLIPBOARD selection.
Richard M. Stallman <rms@gnu.org>
parents: 4246
diff changeset
574 (x-set-cut-buffer text push)
4246
af9d2ade78ed (x-select-text): Always set the cut buffer,
Richard M. Stallman <rms@gnu.org>
parents: 4236
diff changeset
575 (x-set-cut-buffer "" push))
2366
ed9b74c46fb9 * x-win.el: Update copyright to 1993.
Jim Blandy <jimb@redhat.com>
parents: 2157
diff changeset
576 (x-set-selection 'PRIMARY text)
6698
b107e54218fe (x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 6399
diff changeset
577 (if x-select-enable-clipboard
b107e54218fe (x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 6399
diff changeset
578 (x-set-selection 'CLIPBOARD text))
727
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 707
diff changeset
579 (setq x-last-selected-text text))
643
9759addc5671 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 506
diff changeset
580
6399
96ec63c4a347 (x-cut-buffer-or-selection-value): Check for error from x-get-selection.
Karl Heuer <kwzh@gnu.org>
parents: 6319
diff changeset
581 ;;; Return the value of the current X selection.
96ec63c4a347 (x-cut-buffer-or-selection-value): Check for error from x-get-selection.
Karl Heuer <kwzh@gnu.org>
parents: 6319
diff changeset
582 ;;; Consult the selection, then the cut buffer. Treat empty strings
96ec63c4a347 (x-cut-buffer-or-selection-value): Check for error from x-get-selection.
Karl Heuer <kwzh@gnu.org>
parents: 6319
diff changeset
583 ;;; as if they were unset.
707
e4253da532fb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 643
diff changeset
584 (defun x-cut-buffer-or-selection-value ()
1266
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
585 (let (text)
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
586
6399
96ec63c4a347 (x-cut-buffer-or-selection-value): Check for error from x-get-selection.
Karl Heuer <kwzh@gnu.org>
parents: 6319
diff changeset
587 ;; Don't die if x-get-selection signals an error.
96ec63c4a347 (x-cut-buffer-or-selection-value): Check for error from x-get-selection.
Karl Heuer <kwzh@gnu.org>
parents: 6319
diff changeset
588 (condition-case c
96ec63c4a347 (x-cut-buffer-or-selection-value): Check for error from x-get-selection.
Karl Heuer <kwzh@gnu.org>
parents: 6319
diff changeset
589 (setq text (x-get-selection 'PRIMARY))
96ec63c4a347 (x-cut-buffer-or-selection-value): Check for error from x-get-selection.
Karl Heuer <kwzh@gnu.org>
parents: 6319
diff changeset
590 (error (message "%s" c)))
4273
79dc5c3370f8 (x-select-text): Never set the CLIPBOARD selection.
Richard M. Stallman <rms@gnu.org>
parents: 4246
diff changeset
591 (if (string= text "") (setq text nil))
6698
b107e54218fe (x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 6399
diff changeset
592
b107e54218fe (x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 6399
diff changeset
593 (if x-select-enable-clipboard
b107e54218fe (x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 6399
diff changeset
594 (condition-case c
b107e54218fe (x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 6399
diff changeset
595 (setq text (x-get-selection 'CLIPBOARD))
b107e54218fe (x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 6399
diff changeset
596 (error (message "%s" c))))
b107e54218fe (x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 6399
diff changeset
597 (if (string= text "") (setq text nil))
4306
2e51ffb537a8 (x-handle-iconic): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4280
diff changeset
598 (or text (setq text (x-get-cut-buffer 0)))
1266
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
599 (if (string= text "") (setq text nil))
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
600
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
601 (cond
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
602 ((not text) nil)
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
603 ((eq text x-last-selected-text) nil)
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
604 ((string= text x-last-selected-text)
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
605 ;; 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
606 (setq x-last-selected-text text)
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
607 nil)
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
608 (t
bf6b4bc3ccc0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1265
diff changeset
609 (setq x-last-selected-text text)))))
707
e4253da532fb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 643
diff changeset
610
1546
da9a60e97e72 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1266
diff changeset
611
da9a60e97e72 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1266
diff changeset
612 ;;; 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
613 ;;; functions and variables that we use now.
da9a60e97e72 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1266
diff changeset
614
da9a60e97e72 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1266
diff changeset
615 (setq command-line-args (x-handle-args command-line-args))
4132
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
616
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
617 ;;; Make sure we have a valid resource name.
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
618 (or (stringp x-resource-name)
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
619 (let (i)
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
620 (setq x-resource-name (invocation-name))
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
621
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
622 ;; Change any . or * characters in x-resource-name to hyphens,
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
623 ;; so as not to choke when we use it in X resource queries.
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
624 (while (setq i (string-match "[.*]" x-resource-name))
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
625 (aset x-resource-name i ?-))))
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
626
9681
06061a86c50a Make previous change conditional.
Karl Heuer <kwzh@gnu.org>
parents: 9669
diff changeset
627 ;; For the benefit of older Emacses (19.27 and earlier) that are sharing
06061a86c50a Make previous change conditional.
Karl Heuer <kwzh@gnu.org>
parents: 9669
diff changeset
628 ;; the same lisp directory, don't pass the third argument unless we seem
06061a86c50a Make previous change conditional.
Karl Heuer <kwzh@gnu.org>
parents: 9669
diff changeset
629 ;; to have the multi-display support.
06061a86c50a Make previous change conditional.
Karl Heuer <kwzh@gnu.org>
parents: 9669
diff changeset
630 (if (fboundp 'x-close-connection)
06061a86c50a Make previous change conditional.
Karl Heuer <kwzh@gnu.org>
parents: 9669
diff changeset
631 (x-open-connection (or x-display-name
06061a86c50a Make previous change conditional.
Karl Heuer <kwzh@gnu.org>
parents: 9669
diff changeset
632 (setq x-display-name (getenv "DISPLAY")))
06061a86c50a Make previous change conditional.
Karl Heuer <kwzh@gnu.org>
parents: 9669
diff changeset
633 x-command-line-resources
06061a86c50a Make previous change conditional.
Karl Heuer <kwzh@gnu.org>
parents: 9669
diff changeset
634 ;; Exit Emacs with fatal error if this fails.
06061a86c50a Make previous change conditional.
Karl Heuer <kwzh@gnu.org>
parents: 9669
diff changeset
635 t)
06061a86c50a Make previous change conditional.
Karl Heuer <kwzh@gnu.org>
parents: 9669
diff changeset
636 (x-open-connection (or x-display-name
06061a86c50a Make previous change conditional.
Karl Heuer <kwzh@gnu.org>
parents: 9669
diff changeset
637 (setq x-display-name (getenv "DISPLAY")))
06061a86c50a Make previous change conditional.
Karl Heuer <kwzh@gnu.org>
parents: 9669
diff changeset
638 x-command-line-resources))
1546
da9a60e97e72 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 1266
diff changeset
639
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
640 (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
641
4306
2e51ffb537a8 (x-handle-iconic): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4280
diff changeset
642 (setq x-cut-buffer-max (min (- (/ (x-server-max-request-size) 2) 100)
2e51ffb537a8 (x-handle-iconic): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4280
diff changeset
643 x-cut-buffer-max))
2e51ffb537a8 (x-handle-iconic): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4280
diff changeset
644
6792
385261457584 If server is a Sun, call menu-bar-enable-clipboard.
Richard M. Stallman <rms@gnu.org>
parents: 6698
diff changeset
645 ;; Sun expects the menu bar cut and paste commands to use the clipboard.
385261457584 If server is a Sun, call menu-bar-enable-clipboard.
Richard M. Stallman <rms@gnu.org>
parents: 6698
diff changeset
646 (if (string-match "X11/NeWS - Sun Microsystems Inc\\."
385261457584 If server is a Sun, call menu-bar-enable-clipboard.
Richard M. Stallman <rms@gnu.org>
parents: 6698
diff changeset
647 (x-server-vendor))
385261457584 If server is a Sun, call menu-bar-enable-clipboard.
Richard M. Stallman <rms@gnu.org>
parents: 6698
diff changeset
648 (menu-bar-enable-clipboard))
385261457584 If server is a Sun, call menu-bar-enable-clipboard.
Richard M. Stallman <rms@gnu.org>
parents: 6698
diff changeset
649
3172
2a484b449183 * x-win.el: Check for a geometry resource, and apply it to the
Jim Blandy <jimb@redhat.com>
parents: 3081
diff changeset
650 ;; Apply a geometry resource to the initial frame. Put it at the end
2a484b449183 * x-win.el: Check for a geometry resource, and apply it to the
Jim Blandy <jimb@redhat.com>
parents: 3081
diff changeset
651 ;; of the alist, so that anything specified on the command line takes
2a484b449183 * x-win.el: Check for a geometry resource, and apply it to the
Jim Blandy <jimb@redhat.com>
parents: 3081
diff changeset
652 ;; precedence.
2a484b449183 * x-win.el: Check for a geometry resource, and apply it to the
Jim Blandy <jimb@redhat.com>
parents: 3081
diff changeset
653 (let ((res-geometry (x-get-resource "geometry" "Geometry")))
2a484b449183 * x-win.el: Check for a geometry resource, and apply it to the
Jim Blandy <jimb@redhat.com>
parents: 3081
diff changeset
654 (if res-geometry
2a484b449183 * x-win.el: Check for a geometry resource, and apply it to the
Jim Blandy <jimb@redhat.com>
parents: 3081
diff changeset
655 (setq initial-frame-alist (append initial-frame-alist
2a484b449183 * x-win.el: Check for a geometry resource, and apply it to the
Jim Blandy <jimb@redhat.com>
parents: 3081
diff changeset
656 (x-parse-geometry res-geometry)))))
2a484b449183 * x-win.el: Check for a geometry resource, and apply it to the
Jim Blandy <jimb@redhat.com>
parents: 3081
diff changeset
657
3966
dcf86f82f2c8 * term/x-win.el: Check the reverseVideo/ReverseVideo resource,
Jim Blandy <jimb@redhat.com>
parents: 3889
diff changeset
658 ;; Check the reverseVideo resource.
4132
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
659 (let ((case-fold-search t))
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
660 (let ((rv (x-get-resource "reverseVideo" "ReverseVideo")))
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
661 (if (and rv
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
662 (string-match "^\\(true\\|yes\\|on\\)$" rv))
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
663 (setq default-frame-alist
e0345afdf64e * term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
664 (cons '(reverse . t) default-frame-alist)))))
3966
dcf86f82f2c8 * term/x-win.el: Check the reverseVideo/ReverseVideo resource,
Jim Blandy <jimb@redhat.com>
parents: 3889
diff changeset
665
3493
b37b09c0b43d (x-selection-timeout): Set it, using x-get-resource.
Richard M. Stallman <rms@gnu.org>
parents: 3373
diff changeset
666 ;; Set x-selection-timeout, measured in milliseconds.
b37b09c0b43d (x-selection-timeout): Set it, using x-get-resource.
Richard M. Stallman <rms@gnu.org>
parents: 3373
diff changeset
667 (let ((res-selection-timeout
b37b09c0b43d (x-selection-timeout): Set it, using x-get-resource.
Richard M. Stallman <rms@gnu.org>
parents: 3373
diff changeset
668 (x-get-resource "selectionTimeout" "SelectionTimeout")))
4280
fcc66d1d9289 (x-selection-timeout): Use 20000 as default.
Richard M. Stallman <rms@gnu.org>
parents: 4273
diff changeset
669 (setq x-selection-timeout 20000)
3493
b37b09c0b43d (x-selection-timeout): Set it, using x-get-resource.
Richard M. Stallman <rms@gnu.org>
parents: 3373
diff changeset
670 (if res-selection-timeout
b37b09c0b43d (x-selection-timeout): Set it, using x-get-resource.
Richard M. Stallman <rms@gnu.org>
parents: 3373
diff changeset
671 (setq x-selection-timeout (string-to-number res-selection-timeout))))
b37b09c0b43d (x-selection-timeout): Set it, using x-get-resource.
Richard M. Stallman <rms@gnu.org>
parents: 3373
diff changeset
672
2145
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
673 (defun x-win-suspend-error ()
aa0b19850348 Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents: 2143
diff changeset
674 (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
675 (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
676
707
e4253da532fb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 643
diff changeset
677 ;;; 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
678 (setq interprogram-cut-function 'x-select-text)
e4253da532fb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 643
diff changeset
679 (setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
273
0740875c024a *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 192
diff changeset
680
383
4f7094a6b826 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 380
diff changeset
681 ;;; Turn off window-splitting optimization; X is usually fast enough
4f7094a6b826 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 380
diff changeset
682 ;;; that this is only annoying.
4f7094a6b826 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 380
diff changeset
683 (setq split-window-keep-point t)
2157
0d77768bf3f2 Added library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2145
diff changeset
684
0d77768bf3f2 Added library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2145
diff changeset
685 ;;; x-win.el ends here