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