Mercurial > emacs
annotate lisp/term/x-win.el @ 11902:fab32f80adf5
(vendor-specific-keysyms): Add second spelling for HP.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Wed, 24 May 1995 04:59:27 +0000 |
parents | 278e0abb825f |
children | 562d3062b82e |
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 | 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 | 7 ;;; This file is part of GNU Emacs. |
8 ;;; | |
9 ;;; GNU Emacs is free software; you can redistribute it and/or modify | |
10 ;;; it under the terms of the GNU General Public License as published by | |
11 ;;; the Free Software Foundation; either version 2, or (at your option) | |
12 ;;; any later version. | |
13 ;;; | |
14 ;;; GNU Emacs is distributed in the hope that it will be useful, | |
15 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 ;;; GNU General Public License for more details. | |
18 ;;; | |
19 ;;; You should have received a copy of the GNU General Public License | |
20 ;;; along with GNU Emacs; see the file COPYING. If not, write to | |
21 ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
54 | 22 |
2157
0d77768bf3f2
Added library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2145
diff
changeset
|
23 ;;; Commentary: |
54 | 24 |
25 ;; X-win.el: this file is loaded from ../lisp/startup.el when it recognizes | |
26 ;; that X windows are to be used. Command line switches are parsed and those | |
27 ;; pertaining to X are processed and removed from the command line. The | |
28 ;; X display is opened and hooks are set for popping up the initial window. | |
29 | |
30 ;; startup.el will then examine startup files, and eventually call the hooks | |
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 | 34 |
35 ;; These are the standard X switches from the Xt Initialize.c file of | |
36 ;; Release 4. | |
37 | |
38 ;; Command line Resource Manager string | |
39 | |
40 ;; +rv *reverseVideo | |
41 ;; +synchronous *synchronous | |
42 ;; -background *background | |
43 ;; -bd *borderColor | |
44 ;; -bg *background | |
45 ;; -bordercolor *borderColor | |
46 ;; -borderwidth .borderWidth | |
47 ;; -bw .borderWidth | |
48 ;; -display .display | |
49 ;; -fg *foreground | |
50 ;; -fn *font | |
51 ;; -font *font | |
52 ;; -foreground *foreground | |
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 | 56 ;; -iconic .iconic |
57 ;; -name .name | |
58 ;; -reverse *reverseVideo | |
59 ;; -rv *reverseVideo | |
60 ;; -selectionTimeout .selectionTimeout | |
61 ;; -synchronous *synchronous | |
62 ;; -xrm | |
63 | |
64 ;; An alist of X options and the function which handles them. See | |
65 ;; ../startup.el. | |
66 | |
273 | 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 | 69 |
779 | 70 (require 'frame) |
467 | 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 | 75 (require 'menu-bar) |
273 | 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 |
10027
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
81 (defconst x-option-alist |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
82 '(("-bw" . x-handle-numeric-switch) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
83 ("-d" . x-handle-display) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
84 ("-display" . x-handle-display) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
85 ("-name" . x-handle-name-rn-switch) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
86 ("-rn" . x-handle-name-rn-switch) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
87 ("-T" . x-handle-switch) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
88 ("-r" . x-handle-switch) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
89 ("-rv" . x-handle-switch) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
90 ("-reverse" . x-handle-switch) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
91 ("-fn" . x-handle-switch) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
92 ("-font" . x-handle-switch) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
93 ("-ib" . x-handle-numeric-switch) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
94 ("-g" . x-handle-geometry) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
95 ("-geometry" . x-handle-geometry) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
96 ("-fg" . x-handle-switch) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
97 ("-foreground". x-handle-switch) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
98 ("-bg" . x-handle-switch) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
99 ("-background". x-handle-switch) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
100 ("-ms" . x-handle-switch) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
101 ("-itype" . x-handle-switch) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
102 ("-i" . x-handle-switch) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
103 ("-iconic" . x-handle-iconic) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
104 ("-xrm" . x-handle-xrm-switch) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
105 ("-cr" . x-handle-switch) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
106 ("-vb" . x-handle-switch) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
107 ("-hb" . x-handle-switch) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
108 ("-bd" . x-handle-switch))) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
109 |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
110 (defconst x-long-option-alist |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
111 '(("--border-width" . "-bw") |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
112 ("--display" . "-d") |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
113 ("--name" . "-name") |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
114 ("--title" . "-T") |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
115 ("--reverse-video" . "-reverse") |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
116 ("--font" . "-font") |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
117 ("--internal-border" . "-ib") |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
118 ("--geometry" . "-geometry") |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
119 ("--foreground-color" . "-fg") |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
120 ("--background-color" . "-bg") |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
121 ("--mouse-color" . "-ms") |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
122 ("--icon-type" . "-itype") |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
123 ("--iconic" . "-iconic") |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
124 ("--xrm" . "-xrm") |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
125 ("--cursor-color" . "-cr") |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
126 ("--vertical-scroll-bars" . "-vb") |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
127 ("--border-color" . "-bd"))) |
54 | 128 |
129 (defconst x-switch-definitions | |
130 '(("-name" name) | |
131 ("-T" name) | |
3068
32c1cb0149b3
* x-win.el (x-select-text): New arg PUSH.
Jim Blandy <jimb@redhat.com>
parents:
3036
diff
changeset
|
132 ("-r" reverse t) |
32c1cb0149b3
* x-win.el (x-select-text): New arg PUSH.
Jim Blandy <jimb@redhat.com>
parents:
3036
diff
changeset
|
133 ("-rv" reverse t) |
32c1cb0149b3
* x-win.el (x-select-text): New arg PUSH.
Jim Blandy <jimb@redhat.com>
parents:
3036
diff
changeset
|
134 ("-reverse" reverse t) |
54 | 135 ("-fn" font) |
136 ("-font" font) | |
137 ("-ib" internal-border-width) | |
138 ("-fg" foreground-color) | |
139 ("-foreground" foreground-color) | |
140 ("-bg" background-color) | |
141 ("-background" background-color) | |
142 ("-ms" mouse-color) | |
143 ("-cr" cursor-color) | |
1547
2754d53edf5d
(command-switch-alist, x-switch-definitions):
Richard M. Stallman <rms@gnu.org>
parents:
1546
diff
changeset
|
144 ("-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
|
145 ("-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
|
146 ("-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
|
147 ("-hb" horizontal-scroll-bars t) |
54 | 148 ("-bd" border-color) |
149 ("-bw" border-width))) | |
150 | |
151 ;; Handler for switches of the form "-switch value" or "-switch". | |
152 (defun x-handle-switch (switch) | |
153 (let ((aelt (assoc switch x-switch-definitions))) | |
154 (if aelt | |
155 (if (nth 2 aelt) | |
779 | 156 (setq default-frame-alist |
54 | 157 (cons (cons (nth 1 aelt) (nth 2 aelt)) |
779 | 158 default-frame-alist)) |
159 (setq default-frame-alist | |
54 | 160 (cons (cons (nth 1 aelt) |
161 (car x-invocation-args)) | |
779 | 162 default-frame-alist) |
54 | 163 x-invocation-args (cdr x-invocation-args)))))) |
164 | |
4306
2e51ffb537a8
(x-handle-iconic): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4280
diff
changeset
|
165 ;; Make -iconic apply only to the initial frame! |
2e51ffb537a8
(x-handle-iconic): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4280
diff
changeset
|
166 (defun x-handle-iconic (switch) |
2e51ffb537a8
(x-handle-iconic): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4280
diff
changeset
|
167 (setq initial-frame-alist |
2e51ffb537a8
(x-handle-iconic): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4280
diff
changeset
|
168 (cons '(visibility . icon) initial-frame-alist))) |
2e51ffb537a8
(x-handle-iconic): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4280
diff
changeset
|
169 |
54 | 170 ;; Handler for switches of the form "-switch n" |
171 (defun x-handle-numeric-switch (switch) | |
172 (let ((aelt (assoc switch x-switch-definitions))) | |
173 (if aelt | |
779 | 174 (setq default-frame-alist |
54 | 175 (cons (cons (nth 1 aelt) |
176 (string-to-int (car x-invocation-args))) | |
779 | 177 default-frame-alist) |
54 | 178 x-invocation-args |
179 (cdr x-invocation-args))))) | |
180 | |
4132
e0345afdf64e
* term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents:
3966
diff
changeset
|
181 ;; 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
|
182 (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
|
183 (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
|
184 (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
|
185 (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
|
186 (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
|
187 |
54 | 188 ;; Handle the geometry option |
189 (defun x-handle-geometry (switch) | |
7249
876b3518fa78
(x-handle-geometry): Specify user-position and
Richard M. Stallman <rms@gnu.org>
parents:
6792
diff
changeset
|
190 (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
|
191 (setq initial-frame-alist |
876b3518fa78
(x-handle-geometry): Specify user-position and
Richard M. Stallman <rms@gnu.org>
parents:
6792
diff
changeset
|
192 (append initial-frame-alist |
876b3518fa78
(x-handle-geometry): Specify user-position and
Richard M. Stallman <rms@gnu.org>
parents:
6792
diff
changeset
|
193 (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
|
194 '((user-position . t))) |
876b3518fa78
(x-handle-geometry): Specify user-position and
Richard M. Stallman <rms@gnu.org>
parents:
6792
diff
changeset
|
195 (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
|
196 '((user-size . t))) |
876b3518fa78
(x-handle-geometry): Specify user-position and
Richard M. Stallman <rms@gnu.org>
parents:
6792
diff
changeset
|
197 geo) |
876b3518fa78
(x-handle-geometry): Specify user-position and
Richard M. Stallman <rms@gnu.org>
parents:
6792
diff
changeset
|
198 x-invocation-args (cdr x-invocation-args)))) |
54 | 199 |
4132
e0345afdf64e
* term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents:
3966
diff
changeset
|
200 ;; 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
|
201 ;; 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
|
202 ;; 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
|
203 (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
|
204 (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
|
205 (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
|
206 (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
|
207 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
|
208 (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
|
209 (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
|
210 initial-frame-alist)))) |
e0345afdf64e
* term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents:
3966
diff
changeset
|
211 |
54 | 212 (defvar x-display-name nil |
779 | 213 "The X display name specifying server and X frame.") |
54 | 214 |
215 (defun x-handle-display (switch) | |
216 (setq x-display-name (car x-invocation-args) | |
217 x-invocation-args (cdr x-invocation-args))) | |
218 | |
219 (defvar x-invocation-args nil) | |
220 | |
321 | 221 (defun x-handle-args (args) |
6698
b107e54218fe
(x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
6399
diff
changeset
|
222 "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
|
223 This is done before the user's startup file is loaded. They are copied to |
321 | 224 x-invocation args from which the X-related things are extracted, first |
225 the switch (e.g., \"-fg\") in the following code, and possible values | |
7639 | 226 \(e.g., \"black\") in the option handler code (e.g., x-handle-switch). |
321 | 227 This returns ARGS with the arguments that have been processed removed." |
10027
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
228 (message "%s" args) |
273 | 229 (setq x-invocation-args args |
230 args nil) | |
231 (while x-invocation-args | |
232 (let* ((this-switch (car x-invocation-args)) | |
10027
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
233 (orig-this-switch this-switch) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
234 completion argval aelt) |
273 | 235 (setq x-invocation-args (cdr x-invocation-args)) |
10027
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
236 ;; Check for long options with attached arguments |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
237 ;; and separate out the attached option argument into argval. |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
238 (if (string-match "^--[^=]*=" this-switch) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
239 (setq argval (substring this-switch (match-end 0)) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
240 this-switch (substring this-switch 0 (1- (match-end 0))))) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
241 (setq completion (try-completion this-switch x-long-option-alist)) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
242 (if (eq completion t) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
243 ;; Exact match for long option. |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
244 (setq this-switch (cdr (assoc this-switch x-long-option-alist))) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
245 (if (stringp completion) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
246 (let ((elt (assoc completion x-long-option-alist))) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
247 ;; Check for abbreviated long option. |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
248 (or elt |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
249 (error "Option `%s' is ambiguous" this-switch)) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
250 (setq this-switch (cdr elt))) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
251 ;; Check for a short option. |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
252 (setq argval nil this-switch orig-this-switch))) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
253 (setq aelt (assoc this-switch x-option-alist)) |
273 | 254 (if aelt |
10027
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
255 (if argval |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
256 (let ((x-invocation-args |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
257 (cons argval x-invocation-args))) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
258 (funcall (cdr aelt) this-switch)) |
bb1027a75918
(x-option-alist): New variable now holds
Richard M. Stallman <rms@gnu.org>
parents:
9681
diff
changeset
|
259 (funcall (cdr aelt) this-switch)) |
273 | 260 (setq args (cons this-switch args))))) |
261 (setq args (nreverse args))) | |
262 | |
279 | 263 |
54 | 264 |
265 ;; | |
266 ;; Standard X cursor shapes, courtesy of Mr. Fox, who wanted ALL of them. | |
267 ;; | |
268 | |
269 (defconst x-pointer-X-cursor 0) | |
270 (defconst x-pointer-arrow 2) | |
271 (defconst x-pointer-based-arrow-down 4) | |
272 (defconst x-pointer-based-arrow-up 6) | |
273 (defconst x-pointer-boat 8) | |
274 (defconst x-pointer-bogosity 10) | |
275 (defconst x-pointer-bottom-left-corner 12) | |
276 (defconst x-pointer-bottom-right-corner 14) | |
277 (defconst x-pointer-bottom-side 16) | |
278 (defconst x-pointer-bottom-tee 18) | |
279 (defconst x-pointer-box-spiral 20) | |
280 (defconst x-pointer-center-ptr 22) | |
281 (defconst x-pointer-circle 24) | |
282 (defconst x-pointer-clock 26) | |
283 (defconst x-pointer-coffee-mug 28) | |
284 (defconst x-pointer-cross 30) | |
285 (defconst x-pointer-cross-reverse 32) | |
286 (defconst x-pointer-crosshair 34) | |
287 (defconst x-pointer-diamond-cross 36) | |
288 (defconst x-pointer-dot 38) | |
289 (defconst x-pointer-dotbox 40) | |
290 (defconst x-pointer-double-arrow 42) | |
291 (defconst x-pointer-draft-large 44) | |
292 (defconst x-pointer-draft-small 46) | |
293 (defconst x-pointer-draped-box 48) | |
294 (defconst x-pointer-exchange 50) | |
295 (defconst x-pointer-fleur 52) | |
296 (defconst x-pointer-gobbler 54) | |
297 (defconst x-pointer-gumby 56) | |
298 (defconst x-pointer-hand1 58) | |
299 (defconst x-pointer-hand2 60) | |
300 (defconst x-pointer-heart 62) | |
301 (defconst x-pointer-icon 64) | |
302 (defconst x-pointer-iron-cross 66) | |
303 (defconst x-pointer-left-ptr 68) | |
304 (defconst x-pointer-left-side 70) | |
305 (defconst x-pointer-left-tee 72) | |
306 (defconst x-pointer-leftbutton 74) | |
307 (defconst x-pointer-ll-angle 76) | |
308 (defconst x-pointer-lr-angle 78) | |
309 (defconst x-pointer-man 80) | |
310 (defconst x-pointer-middlebutton 82) | |
311 (defconst x-pointer-mouse 84) | |
312 (defconst x-pointer-pencil 86) | |
313 (defconst x-pointer-pirate 88) | |
314 (defconst x-pointer-plus 90) | |
315 (defconst x-pointer-question-arrow 92) | |
316 (defconst x-pointer-right-ptr 94) | |
317 (defconst x-pointer-right-side 96) | |
318 (defconst x-pointer-right-tee 98) | |
319 (defconst x-pointer-rightbutton 100) | |
320 (defconst x-pointer-rtl-logo 102) | |
321 (defconst x-pointer-sailboat 104) | |
322 (defconst x-pointer-sb-down-arrow 106) | |
323 (defconst x-pointer-sb-h-double-arrow 108) | |
324 (defconst x-pointer-sb-left-arrow 110) | |
325 (defconst x-pointer-sb-right-arrow 112) | |
326 (defconst x-pointer-sb-up-arrow 114) | |
327 (defconst x-pointer-sb-v-double-arrow 116) | |
328 (defconst x-pointer-shuttle 118) | |
329 (defconst x-pointer-sizing 120) | |
330 (defconst x-pointer-spider 122) | |
331 (defconst x-pointer-spraycan 124) | |
332 (defconst x-pointer-star 126) | |
333 (defconst x-pointer-target 128) | |
334 (defconst x-pointer-tcross 130) | |
335 (defconst x-pointer-top-left-arrow 132) | |
336 (defconst x-pointer-top-left-corner 134) | |
337 (defconst x-pointer-top-right-corner 136) | |
338 (defconst x-pointer-top-side 138) | |
339 (defconst x-pointer-top-tee 140) | |
340 (defconst x-pointer-trek 142) | |
341 (defconst x-pointer-ul-angle 144) | |
342 (defconst x-pointer-umbrella 146) | |
343 (defconst x-pointer-ur-angle 148) | |
344 (defconst x-pointer-watch 150) | |
345 (defconst x-pointer-xterm 152) | |
346 | |
347 ;; | |
348 ;; Available colors | |
349 ;; | |
350 | |
351 (defvar x-colors '("aquamarine" | |
352 "Aquamarine" | |
353 "medium aquamarine" | |
354 "MediumAquamarine" | |
355 "black" | |
356 "Black" | |
357 "blue" | |
358 "Blue" | |
359 "cadet blue" | |
360 "CadetBlue" | |
361 "cornflower blue" | |
362 "CornflowerBlue" | |
363 "dark slate blue" | |
364 "DarkSlateBlue" | |
365 "light blue" | |
366 "LightBlue" | |
367 "light steel blue" | |
368 "LightSteelBlue" | |
369 "medium blue" | |
370 "MediumBlue" | |
371 "medium slate blue" | |
372 "MediumSlateBlue" | |
373 "midnight blue" | |
374 "MidnightBlue" | |
375 "navy blue" | |
376 "NavyBlue" | |
377 "navy" | |
378 "Navy" | |
379 "sky blue" | |
380 "SkyBlue" | |
381 "slate blue" | |
382 "SlateBlue" | |
383 "steel blue" | |
384 "SteelBlue" | |
385 "coral" | |
386 "Coral" | |
387 "cyan" | |
388 "Cyan" | |
389 "firebrick" | |
390 "Firebrick" | |
391 "brown" | |
392 "Brown" | |
393 "gold" | |
394 "Gold" | |
395 "goldenrod" | |
396 "Goldenrod" | |
397 "green" | |
398 "Green" | |
399 "dark green" | |
400 "DarkGreen" | |
401 "dark olive green" | |
402 "DarkOliveGreen" | |
403 "forest green" | |
404 "ForestGreen" | |
405 "lime green" | |
406 "LimeGreen" | |
407 "medium sea green" | |
408 "MediumSeaGreen" | |
409 "medium spring green" | |
410 "MediumSpringGreen" | |
411 "pale green" | |
412 "PaleGreen" | |
413 "sea green" | |
414 "SeaGreen" | |
415 "spring green" | |
416 "SpringGreen" | |
417 "yellow green" | |
418 "YellowGreen" | |
419 "dark slate grey" | |
420 "DarkSlateGrey" | |
421 "dark slate gray" | |
422 "DarkSlateGray" | |
423 "dim grey" | |
424 "DimGrey" | |
425 "dim gray" | |
426 "DimGray" | |
427 "light grey" | |
428 "LightGrey" | |
429 "light gray" | |
430 "LightGray" | |
431 "gray" | |
432 "grey" | |
433 "Gray" | |
434 "Grey" | |
435 "khaki" | |
436 "Khaki" | |
437 "magenta" | |
438 "Magenta" | |
439 "maroon" | |
440 "Maroon" | |
441 "orange" | |
442 "Orange" | |
443 "orchid" | |
444 "Orchid" | |
445 "dark orchid" | |
446 "DarkOrchid" | |
447 "medium orchid" | |
448 "MediumOrchid" | |
449 "pink" | |
450 "Pink" | |
451 "plum" | |
452 "Plum" | |
453 "red" | |
454 "Red" | |
455 "indian red" | |
456 "IndianRed" | |
457 "medium violet red" | |
458 "MediumVioletRed" | |
459 "orange red" | |
460 "OrangeRed" | |
461 "violet red" | |
462 "VioletRed" | |
463 "salmon" | |
464 "Salmon" | |
465 "sienna" | |
466 "Sienna" | |
467 "tan" | |
468 "Tan" | |
469 "thistle" | |
470 "Thistle" | |
471 "turquoise" | |
472 "Turquoise" | |
473 "dark turquoise" | |
474 "DarkTurquoise" | |
475 "medium turquoise" | |
476 "MediumTurquoise" | |
477 "violet" | |
478 "Violet" | |
479 "blue violet" | |
480 "BlueViolet" | |
481 "wheat" | |
482 "Wheat" | |
483 "white" | |
484 "White" | |
485 "yellow" | |
486 "Yellow" | |
487 "green yellow" | |
488 "GreenYellow") | |
11466
8fb524439d09
(x-defined-colors): Take frame as optional arg.
Richard M. Stallman <rms@gnu.org>
parents:
11319
diff
changeset
|
489 "The full list of X colors from the `rgb.text' file.") |
54 | 490 |
11466
8fb524439d09
(x-defined-colors): Take frame as optional arg.
Richard M. Stallman <rms@gnu.org>
parents:
11319
diff
changeset
|
491 (defun x-defined-colors (&optional frame) |
8fb524439d09
(x-defined-colors): Take frame as optional arg.
Richard M. Stallman <rms@gnu.org>
parents:
11319
diff
changeset
|
492 "Return a list of colors supported for a particular frame. |
8fb524439d09
(x-defined-colors): Take frame as optional arg.
Richard M. Stallman <rms@gnu.org>
parents:
11319
diff
changeset
|
493 The argument FRAME specifies which frame to try. |
8fb524439d09
(x-defined-colors): Take frame as optional arg.
Richard M. Stallman <rms@gnu.org>
parents:
11319
diff
changeset
|
494 The value may be different for frames on different X displays." |
8fb524439d09
(x-defined-colors): Take frame as optional arg.
Richard M. Stallman <rms@gnu.org>
parents:
11319
diff
changeset
|
495 (or frame (setq frame (selected-frame))) |
54 | 496 (let ((all-colors x-colors) |
497 (this-color nil) | |
498 (defined-colors nil)) | |
499 (while all-colors | |
500 (setq this-color (car all-colors) | |
501 all-colors (cdr all-colors)) | |
11466
8fb524439d09
(x-defined-colors): Take frame as optional arg.
Richard M. Stallman <rms@gnu.org>
parents:
11319
diff
changeset
|
502 (and (face-color-supported-p frame this-color t) |
54 | 503 (setq defined-colors (cons this-color defined-colors)))) |
504 defined-colors)) | |
396 | 505 |
506 ;;;; Function keys | |
507 | |
4313
87472f1eb031
(iconify-or-deiconify-frame): New function. Use it for C-z.
Richard M. Stallman <rms@gnu.org>
parents:
4306
diff
changeset
|
508 (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
|
509 "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
|
510 (interactive) |
87472f1eb031
(iconify-or-deiconify-frame): New function. Use it for C-z.
Richard M. Stallman <rms@gnu.org>
parents:
4306
diff
changeset
|
511 (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
|
512 (iconify-frame) |
6141
fefa088fc7f9
(iconify-or-deiconify-frame): Don't make invisible before making visible.
Karl Heuer <kwzh@gnu.org>
parents:
6137
diff
changeset
|
513 (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
|
514 |
87472f1eb031
(iconify-or-deiconify-frame): New function. Use it for C-z.
Richard M. Stallman <rms@gnu.org>
parents:
4306
diff
changeset
|
515 (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
|
516 global-map) |
1546 | 517 |
2145
aa0b19850348
Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents:
2143
diff
changeset
|
518 ;; Map certain keypad keys into ASCII characters |
aa0b19850348
Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents:
2143
diff
changeset
|
519 ;; that people usually expect. |
aa0b19850348
Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents:
2143
diff
changeset
|
520 (define-key function-key-map [backspace] [127]) |
aa0b19850348
Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents:
2143
diff
changeset
|
521 (define-key function-key-map [delete] [127]) |
aa0b19850348
Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents:
2143
diff
changeset
|
522 (define-key function-key-map [tab] [?\t]) |
aa0b19850348
Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents:
2143
diff
changeset
|
523 (define-key function-key-map [linefeed] [?\n]) |
aa0b19850348
Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents:
2143
diff
changeset
|
524 (define-key function-key-map [clear] [11]) |
aa0b19850348
Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents:
2143
diff
changeset
|
525 (define-key function-key-map [return] [13]) |
aa0b19850348
Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents:
2143
diff
changeset
|
526 (define-key function-key-map [escape] [?\e]) |
aa0b19850348
Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents:
2143
diff
changeset
|
527 (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
|
528 (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
|
529 (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
|
530 (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
|
531 (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
|
532 (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
|
533 (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
|
534 |
aa0b19850348
Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents:
2143
diff
changeset
|
535 ;; These tell read-char how to convert |
aa0b19850348
Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents:
2143
diff
changeset
|
536 ;; these special chars to ASCII. |
aa0b19850348
Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents:
2143
diff
changeset
|
537 (put 'backspace 'ascii-character 127) |
aa0b19850348
Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents:
2143
diff
changeset
|
538 (put 'delete 'ascii-character 127) |
aa0b19850348
Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents:
2143
diff
changeset
|
539 (put 'tab 'ascii-character ?\t) |
aa0b19850348
Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents:
2143
diff
changeset
|
540 (put 'linefeed 'ascii-character ?\n) |
aa0b19850348
Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents:
2143
diff
changeset
|
541 (put 'clear 'ascii-character 12) |
aa0b19850348
Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents:
2143
diff
changeset
|
542 (put 'return 'ascii-character 13) |
aa0b19850348
Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents:
2143
diff
changeset
|
543 (put 'escape 'ascii-character ?\e) |
5515
920b55d2057b
(vendor-key-syms): Set this variable.
Richard M. Stallman <rms@gnu.org>
parents:
4314
diff
changeset
|
544 |
11821
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
545 (defun vendor-specific-keysyms (vendor) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
546 "Return the appropriate value of system-key-alist for VENDOR. |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
547 VENDOR is a string containing the name of the X Server's vendor, |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
548 as returned by (x-server-vendor)." |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
549 (cond ((string-equal vendor "Apollo Computer Inc.") |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
550 '((65280 . linedel) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
551 (65281 . chardel) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
552 (65282 . copy) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
553 (65283 . cut) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
554 (65284 . paste) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
555 (65285 . move) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
556 (65286 . grow) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
557 (65287 . cmd) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
558 (65288 . shell) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
559 (65289 . leftbar) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
560 (65290 . rightbar) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
561 (65291 . leftbox) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
562 (65292 . rightbox) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
563 (65293 . upbox) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
564 (65294 . downbox) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
565 (65295 . pop) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
566 (65296 . read) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
567 (65297 . edit) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
568 (65298 . save) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
569 (65299 . exit) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
570 (65300 . repeat))) |
11902
fab32f80adf5
(vendor-specific-keysyms): Add second spelling for HP.
Karl Heuer <kwzh@gnu.org>
parents:
11821
diff
changeset
|
571 ((or (string-equal vendor "Hewlett-Packard Incorporated") |
fab32f80adf5
(vendor-specific-keysyms): Add second spelling for HP.
Karl Heuer <kwzh@gnu.org>
parents:
11821
diff
changeset
|
572 (string-equal vendor "Hewlett-Packard Company")) |
11821
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
573 '(( 168 . mute-acute) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
574 ( 169 . mute-grave) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
575 ( 170 . mute-asciicircum) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
576 ( 171 . mute-diaeresis) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
577 ( 172 . mute-asciitilde) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
578 ( 175 . lira) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
579 ( 190 . guilder) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
580 ( 252 . block) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
581 ( 256 . longminus) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
582 (65388 . reset) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
583 (65389 . system) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
584 (65390 . user) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
585 (65391 . clearline) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
586 (65392 . insertline) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
587 (65393 . deleteline) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
588 (65394 . insertchar) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
589 (65395 . deletechar) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
590 (65396 . backtab) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
591 (65397 . kp-backtab))) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
592 ((string-equal vendor "X11/NeWS - Sun Microsystems Inc.") |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
593 '((392976 . f35) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
594 (392977 . f36) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
595 (393056 . req) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
596 ;; These are for Sun under X11R6 |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
597 (393072 . props) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
598 (393073 . front) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
599 (393074 . copy) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
600 (393075 . open) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
601 (393076 . paste) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
602 (393077 . cut))) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
603 (t |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
604 ;; This is used by DEC's X server. |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
605 '((65280 . remove))))) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
606 |
54 | 607 |
1546 | 608 ;;;; Selections and cut buffers |
707 | 609 |
727 | 610 ;;; We keep track of the last text selected here, so we can check the |
611 ;;; current selection against it, and avoid passing back our own text | |
612 ;;; from x-cut-buffer-or-selection-value. | |
613 (defvar x-last-selected-text nil) | |
614 | |
4273
79dc5c3370f8
(x-select-text): Never set the CLIPBOARD selection.
Richard M. Stallman <rms@gnu.org>
parents:
4246
diff
changeset
|
615 ;;; 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
|
616 ;;; Note this value is overridden below. |
2e51ffb537a8
(x-handle-iconic): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4280
diff
changeset
|
617 (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
|
618 "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
|
619 |
6698
b107e54218fe
(x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
6399
diff
changeset
|
620 (defvar x-select-enable-clipboard nil |
b107e54218fe
(x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
6399
diff
changeset
|
621 "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
|
622 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
|
623 |
4273
79dc5c3370f8
(x-select-text): Never set the CLIPBOARD selection.
Richard M. Stallman <rms@gnu.org>
parents:
4246
diff
changeset
|
624 ;;; Make TEXT, a string, the primary X selection. |
707 | 625 ;;; 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
|
626 ;;; with older X applications. |
4273
79dc5c3370f8
(x-select-text): Never set the CLIPBOARD selection.
Richard M. Stallman <rms@gnu.org>
parents:
4246
diff
changeset
|
627 ;;; 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
|
628 ;;; in the clipboard. |
3036
98f500ca5593
(x-select-text): New arg PUSH.
Richard M. Stallman <rms@gnu.org>
parents:
2808
diff
changeset
|
629 (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
|
630 ;; 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
|
631 ;; 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
|
632 (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
|
633 (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
|
634 (x-set-cut-buffer "" push)) |
2366
ed9b74c46fb9
* x-win.el: Update copyright to 1993.
Jim Blandy <jimb@redhat.com>
parents:
2157
diff
changeset
|
635 (x-set-selection 'PRIMARY text) |
6698
b107e54218fe
(x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
6399
diff
changeset
|
636 (if x-select-enable-clipboard |
b107e54218fe
(x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
6399
diff
changeset
|
637 (x-set-selection 'CLIPBOARD text)) |
727 | 638 (setq x-last-selected-text text)) |
643 | 639 |
6399
96ec63c4a347
(x-cut-buffer-or-selection-value): Check for error from x-get-selection.
Karl Heuer <kwzh@gnu.org>
parents:
6319
diff
changeset
|
640 ;;; 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
|
641 ;;; 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
|
642 ;;; as if they were unset. |
707 | 643 (defun x-cut-buffer-or-selection-value () |
1266 | 644 (let (text) |
645 | |
6399
96ec63c4a347
(x-cut-buffer-or-selection-value): Check for error from x-get-selection.
Karl Heuer <kwzh@gnu.org>
parents:
6319
diff
changeset
|
646 ;; 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
|
647 (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
|
648 (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
|
649 (error (message "%s" c))) |
4273
79dc5c3370f8
(x-select-text): Never set the CLIPBOARD selection.
Richard M. Stallman <rms@gnu.org>
parents:
4246
diff
changeset
|
650 (if (string= text "") (setq text nil)) |
6698
b107e54218fe
(x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
6399
diff
changeset
|
651 |
b107e54218fe
(x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
6399
diff
changeset
|
652 (if x-select-enable-clipboard |
b107e54218fe
(x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
6399
diff
changeset
|
653 (condition-case c |
b107e54218fe
(x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
6399
diff
changeset
|
654 (setq text (x-get-selection 'CLIPBOARD)) |
b107e54218fe
(x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
6399
diff
changeset
|
655 (error (message "%s" c)))) |
b107e54218fe
(x-select-enable-clipboard): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
6399
diff
changeset
|
656 (if (string= text "") (setq text nil)) |
4306
2e51ffb537a8
(x-handle-iconic): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4280
diff
changeset
|
657 (or text (setq text (x-get-cut-buffer 0))) |
1266 | 658 (if (string= text "") (setq text nil)) |
659 | |
660 (cond | |
661 ((not text) nil) | |
662 ((eq text x-last-selected-text) nil) | |
663 ((string= text x-last-selected-text) | |
664 ;; Record the newer string, so subsequent calls can use the `eq' test. | |
665 (setq x-last-selected-text text) | |
666 nil) | |
667 (t | |
668 (setq x-last-selected-text text))))) | |
707 | 669 |
1546 | 670 |
671 ;;; Do the actual X Windows setup here; the above code just defines | |
672 ;;; functions and variables that we use now. | |
673 | |
674 (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
|
675 |
e0345afdf64e
* term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents:
3966
diff
changeset
|
676 ;;; 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
|
677 (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
|
678 (let (i) |
e0345afdf64e
* term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents:
3966
diff
changeset
|
679 (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
|
680 |
e0345afdf64e
* term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents:
3966
diff
changeset
|
681 ;; 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
|
682 ;; 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
|
683 (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
|
684 (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
|
685 |
9681
06061a86c50a
Make previous change conditional.
Karl Heuer <kwzh@gnu.org>
parents:
9669
diff
changeset
|
686 ;; 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
|
687 ;; 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
|
688 ;; to have the multi-display support. |
06061a86c50a
Make previous change conditional.
Karl Heuer <kwzh@gnu.org>
parents:
9669
diff
changeset
|
689 (if (fboundp 'x-close-connection) |
06061a86c50a
Make previous change conditional.
Karl Heuer <kwzh@gnu.org>
parents:
9669
diff
changeset
|
690 (x-open-connection (or x-display-name |
06061a86c50a
Make previous change conditional.
Karl Heuer <kwzh@gnu.org>
parents:
9669
diff
changeset
|
691 (setq x-display-name (getenv "DISPLAY"))) |
06061a86c50a
Make previous change conditional.
Karl Heuer <kwzh@gnu.org>
parents:
9669
diff
changeset
|
692 x-command-line-resources |
06061a86c50a
Make previous change conditional.
Karl Heuer <kwzh@gnu.org>
parents:
9669
diff
changeset
|
693 ;; Exit Emacs with fatal error if this fails. |
06061a86c50a
Make previous change conditional.
Karl Heuer <kwzh@gnu.org>
parents:
9669
diff
changeset
|
694 t) |
06061a86c50a
Make previous change conditional.
Karl Heuer <kwzh@gnu.org>
parents:
9669
diff
changeset
|
695 (x-open-connection (or x-display-name |
06061a86c50a
Make previous change conditional.
Karl Heuer <kwzh@gnu.org>
parents:
9669
diff
changeset
|
696 (setq x-display-name (getenv "DISPLAY"))) |
06061a86c50a
Make previous change conditional.
Karl Heuer <kwzh@gnu.org>
parents:
9669
diff
changeset
|
697 x-command-line-resources)) |
1546 | 698 |
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
|
699 (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
|
700 |
4306
2e51ffb537a8
(x-handle-iconic): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4280
diff
changeset
|
701 (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
|
702 x-cut-buffer-max)) |
2e51ffb537a8
(x-handle-iconic): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4280
diff
changeset
|
703 |
6792
385261457584
If server is a Sun, call menu-bar-enable-clipboard.
Richard M. Stallman <rms@gnu.org>
parents:
6698
diff
changeset
|
704 ;; Sun expects the menu bar cut and paste commands to use the clipboard. |
10056
920dae6ba331
(Calling menu-bar-enable-clipboard): Be less selective matching Suns.
Richard M. Stallman <rms@gnu.org>
parents:
10027
diff
changeset
|
705 ;; This has ,? to match both on Sunos and on Solaris. |
920dae6ba331
(Calling menu-bar-enable-clipboard): Be less selective matching Suns.
Richard M. Stallman <rms@gnu.org>
parents:
10027
diff
changeset
|
706 (if (string-match " Sun Microsystems,? Inc\\." |
6792
385261457584
If server is a Sun, call menu-bar-enable-clipboard.
Richard M. Stallman <rms@gnu.org>
parents:
6698
diff
changeset
|
707 (x-server-vendor)) |
385261457584
If server is a Sun, call menu-bar-enable-clipboard.
Richard M. Stallman <rms@gnu.org>
parents:
6698
diff
changeset
|
708 (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
|
709 |
3172
2a484b449183
* x-win.el: Check for a geometry resource, and apply it to the
Jim Blandy <jimb@redhat.com>
parents:
3081
diff
changeset
|
710 ;; 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
|
711 ;; 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
|
712 ;; precedence. |
10400
2743977604b1
Put height and width from geometry parm into default-frame-alist.
Richard M. Stallman <rms@gnu.org>
parents:
10094
diff
changeset
|
713 (let* ((res-geometry (x-get-resource "geometry" "Geometry")) |
2743977604b1
Put height and width from geometry parm into default-frame-alist.
Richard M. Stallman <rms@gnu.org>
parents:
10094
diff
changeset
|
714 parsed) |
3172
2a484b449183
* x-win.el: Check for a geometry resource, and apply it to the
Jim Blandy <jimb@redhat.com>
parents:
3081
diff
changeset
|
715 (if res-geometry |
10400
2743977604b1
Put height and width from geometry parm into default-frame-alist.
Richard M. Stallman <rms@gnu.org>
parents:
10094
diff
changeset
|
716 (progn |
2743977604b1
Put height and width from geometry parm into default-frame-alist.
Richard M. Stallman <rms@gnu.org>
parents:
10094
diff
changeset
|
717 (setq parsed (x-parse-geometry res-geometry)) |
11821
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
718 ;; If the resource specifies a position, |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
719 ;; call the position and size "user-specified". |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
720 (if (or (assq 'top parsed) (assq 'left parsed)) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
721 (setq parsed (cons '(user-position . t) |
278e0abb825f
If the geometry resource specifies a position,
Richard M. Stallman <rms@gnu.org>
parents:
11718
diff
changeset
|
722 (cons '(user-size . t) parsed)))) |
10400
2743977604b1
Put height and width from geometry parm into default-frame-alist.
Richard M. Stallman <rms@gnu.org>
parents:
10094
diff
changeset
|
723 ;; All geometry parms apply to the initial frame. |
2743977604b1
Put height and width from geometry parm into default-frame-alist.
Richard M. Stallman <rms@gnu.org>
parents:
10094
diff
changeset
|
724 (setq initial-frame-alist (append initial-frame-alist parsed)) |
2743977604b1
Put height and width from geometry parm into default-frame-alist.
Richard M. Stallman <rms@gnu.org>
parents:
10094
diff
changeset
|
725 ;; The size parms apply to all frames. |
2743977604b1
Put height and width from geometry parm into default-frame-alist.
Richard M. Stallman <rms@gnu.org>
parents:
10094
diff
changeset
|
726 (if (assq 'height parsed) |
2743977604b1
Put height and width from geometry parm into default-frame-alist.
Richard M. Stallman <rms@gnu.org>
parents:
10094
diff
changeset
|
727 (setq default-frame-alist |
2743977604b1
Put height and width from geometry parm into default-frame-alist.
Richard M. Stallman <rms@gnu.org>
parents:
10094
diff
changeset
|
728 (cons (cons 'height (cdr (assq 'height parsed))) |
2743977604b1
Put height and width from geometry parm into default-frame-alist.
Richard M. Stallman <rms@gnu.org>
parents:
10094
diff
changeset
|
729 default-frame-alist))) |
2743977604b1
Put height and width from geometry parm into default-frame-alist.
Richard M. Stallman <rms@gnu.org>
parents:
10094
diff
changeset
|
730 (if (assq 'width parsed) |
2743977604b1
Put height and width from geometry parm into default-frame-alist.
Richard M. Stallman <rms@gnu.org>
parents:
10094
diff
changeset
|
731 (setq default-frame-alist |
2743977604b1
Put height and width from geometry parm into default-frame-alist.
Richard M. Stallman <rms@gnu.org>
parents:
10094
diff
changeset
|
732 (cons (cons 'width (cdr (assq 'width parsed))) |
2743977604b1
Put height and width from geometry parm into default-frame-alist.
Richard M. Stallman <rms@gnu.org>
parents:
10094
diff
changeset
|
733 default-frame-alist)))))) |
3172
2a484b449183
* x-win.el: Check for a geometry resource, and apply it to the
Jim Blandy <jimb@redhat.com>
parents:
3081
diff
changeset
|
734 |
3966
dcf86f82f2c8
* term/x-win.el: Check the reverseVideo/ReverseVideo resource,
Jim Blandy <jimb@redhat.com>
parents:
3889
diff
changeset
|
735 ;; 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
|
736 (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
|
737 (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
|
738 (if (and rv |
e0345afdf64e
* term/x-win.el: Include (invocation-name) in the error messages
Jim Blandy <jimb@redhat.com>
parents:
3966
diff
changeset
|
739 (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
|
740 (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
|
741 (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
|
742 |
3493
b37b09c0b43d
(x-selection-timeout): Set it, using x-get-resource.
Richard M. Stallman <rms@gnu.org>
parents:
3373
diff
changeset
|
743 ;; 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
|
744 (let ((res-selection-timeout |
b37b09c0b43d
(x-selection-timeout): Set it, using x-get-resource.
Richard M. Stallman <rms@gnu.org>
parents:
3373
diff
changeset
|
745 (x-get-resource "selectionTimeout" "SelectionTimeout"))) |
4280
fcc66d1d9289
(x-selection-timeout): Use 20000 as default.
Richard M. Stallman <rms@gnu.org>
parents:
4273
diff
changeset
|
746 (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
|
747 (if res-selection-timeout |
b37b09c0b43d
(x-selection-timeout): Set it, using x-get-resource.
Richard M. Stallman <rms@gnu.org>
parents:
3373
diff
changeset
|
748 (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
|
749 |
2145
aa0b19850348
Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents:
2143
diff
changeset
|
750 (defun x-win-suspend-error () |
aa0b19850348
Cancel previous change, since it discarded
Richard M. Stallman <rms@gnu.org>
parents:
2143
diff
changeset
|
751 (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
|
752 (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
|
753 |
707 | 754 ;;; Arrange for the kill and yank functions to set and check the clipboard. |
755 (setq interprogram-cut-function 'x-select-text) | |
756 (setq interprogram-paste-function 'x-cut-buffer-or-selection-value) | |
273 | 757 |
383 | 758 ;;; Turn off window-splitting optimization; X is usually fast enough |
759 ;;; that this is only annoying. | |
760 (setq split-window-keep-point t) | |
2157
0d77768bf3f2
Added library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2145
diff
changeset
|
761 |
11290
e7510a23df8e
(mode-line-buffer-identification): Eliminate %F.
Richard M. Stallman <rms@gnu.org>
parents:
10400
diff
changeset
|
762 ;; Don't show the frame name; that's redundant with X. |
11319
95b2cea7c54a
(mode-line-buffer-identification): Fix prev change; use setq-default.
Richard M. Stallman <rms@gnu.org>
parents:
11290
diff
changeset
|
763 (setq-default mode-line-buffer-identification '("Emacs: %12b")) |
11290
e7510a23df8e
(mode-line-buffer-identification): Eliminate %F.
Richard M. Stallman <rms@gnu.org>
parents:
10400
diff
changeset
|
764 |
2157
0d77768bf3f2
Added library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2145
diff
changeset
|
765 ;;; x-win.el ends here |