(defgroup reftex): Update home page url-link.
[bpt/emacs.git] / lisp / term / x-win.el
CommitLineData
cf07d2bd 1;;; x-win.el --- parse relevant switches and set up for X -*-coding: iso-2022-7bit;-*-
2fe590dc 2
5fd6d89f 3;; Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004,
ceb4c4d3 4;; 2005, 2006 Free Software Foundation, Inc.
5cdb3f1e
ER
5
6;; Author: FSF
cf07d2bd 7;; Keywords: terminals, i18n
5cdb3f1e 8
2fe590dc
EN
9;; This file is part of GNU Emacs.
10
11;; GNU Emacs is free software; you can redistribute it and/or modify
12;; it under the terms of the GNU General Public License as published by
13;; the Free Software Foundation; either version 2, or (at your option)
14;; any later version.
15
16;; GNU Emacs is distributed in the hope that it will be useful,
17;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;; GNU General Public License for more details.
20
21;; You should have received a copy of the GNU General Public License
22;; along with GNU Emacs; see the file COPYING. If not, write to the
4fc5845f
LK
23;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24;; Boston, MA 02110-1301, USA.
63f77899 25
5cdb3f1e 26;;; Commentary:
63f77899
JB
27
28;; X-win.el: this file is loaded from ../lisp/startup.el when it recognizes
29;; that X windows are to be used. Command line switches are parsed and those
30;; pertaining to X are processed and removed from the command line. The
31;; X display is opened and hooks are set for popping up the initial window.
32
33;; startup.el will then examine startup files, and eventually call the hooks
cf07d2bd 34;; which create the first window(s).
5cdb3f1e
ER
35
36;;; Code:
63f77899
JB
37\f
38;; These are the standard X switches from the Xt Initialize.c file of
39;; Release 4.
40
41;; Command line Resource Manager string
42
43;; +rv *reverseVideo
44;; +synchronous *synchronous
45;; -background *background
46;; -bd *borderColor
47;; -bg *background
48;; -bordercolor *borderColor
49;; -borderwidth .borderWidth
50;; -bw .borderWidth
51;; -display .display
52;; -fg *foreground
53;; -fn *font
54;; -font *font
55;; -foreground *foreground
56;; -geometry .geometry
57;; -iconic .iconic
58;; -name .name
59;; -reverse *reverseVideo
60;; -rv *reverseVideo
61;; -selectionTimeout .selectionTimeout
62;; -synchronous *synchronous
63f77899
JB
63;; -xrm
64
63f77899
JB
65;; An alist of X options and the function which handles them. See
66;; ../startup.el.
67
63c86e17 68(if (not (eq window-system 'x))
800642d2 69 (error "%s: Loading x-win.el but not compiled for X" (invocation-name)))
db95369b 70
0cc89026 71(require 'frame)
3eb43f71 72(require 'mouse)
b16795eb 73(require 'scroll-bar)
ffe1dd7a
JB
74(require 'faces)
75(require 'select)
290cb602 76(require 'menu-bar)
6acdd93e 77(require 'fontset)
133aad74 78(require 'x-dnd)
63c86e17 79
19b08de9 80(defvar x-invocation-args)
cc5e32c5
JB
81(defvar x-keysym-table)
82(defvar x-selection-timeout)
83(defvar x-session-id)
84(defvar x-session-previous-id)
19b08de9 85
f6f6d98c
RS
86(defvar x-command-line-resources nil)
87
63f77899
JB
88;; Handler for switches of the form "-switch value" or "-switch".
89(defun x-handle-switch (switch)
80128ceb 90 (let ((aelt (assoc switch command-line-x-option-alist)))
63f77899 91 (if aelt
80128ceb
RS
92 (let ((param (nth 3 aelt))
93 (value (nth 4 aelt)))
94 (if value
95 (setq default-frame-alist
96 (cons (cons param value)
97 default-frame-alist))
0cc89026 98 (setq default-frame-alist
80128ceb
RS
99 (cons (cons param
100 (car x-invocation-args))
101 default-frame-alist)
102 x-invocation-args (cdr x-invocation-args)))))))
103
104;; Handler for switches of the form "-switch n"
105(defun x-handle-numeric-switch (switch)
106 (let ((aelt (assoc switch command-line-x-option-alist)))
107 (if aelt
108 (let ((param (nth 3 aelt)))
0cc89026 109 (setq default-frame-alist
80128ceb 110 (cons (cons param
027a4b6b 111 (string-to-number (car x-invocation-args)))
0cc89026 112 default-frame-alist)
80128ceb
RS
113 x-invocation-args
114 (cdr x-invocation-args))))))
63f77899 115
2f9b363a
EZ
116;; Handle options that apply to initial frame only
117(defun x-handle-initial-switch (switch)
118 (let ((aelt (assoc switch command-line-x-option-alist)))
119 (if aelt
120 (let ((param (nth 3 aelt))
121 (value (nth 4 aelt)))
122 (if value
123 (setq initial-frame-alist
124 (cons (cons param value)
125 initial-frame-alist))
126 (setq initial-frame-alist
127 (cons (cons param
128 (car x-invocation-args))
129 initial-frame-alist)
130 x-invocation-args (cdr x-invocation-args)))))))
131
ef599142
RS
132;; Make -iconic apply only to the initial frame!
133(defun x-handle-iconic (switch)
134 (setq initial-frame-alist
135 (cons '(visibility . icon) initial-frame-alist)))
136
800642d2
JB
137;; Handle the -xrm option.
138(defun x-handle-xrm-switch (switch)
2025ddca
GM
139 (unless (consp x-invocation-args)
140 (error "%s: missing argument to `%s' option" (invocation-name) switch))
141 (setq x-command-line-resources
142 (if (null x-command-line-resources)
143 (car x-invocation-args)
144 (concat x-command-line-resources "\n" (car x-invocation-args))))
f6f6d98c
RS
145 (setq x-invocation-args (cdr x-invocation-args)))
146
63f77899
JB
147;; Handle the geometry option
148(defun x-handle-geometry (switch)
ea8d3061
RS
149 (let* ((geo (x-parse-geometry (car x-invocation-args)))
150 (left (assq 'left geo))
151 (top (assq 'top geo))
152 (height (assq 'height geo))
153 (width (assq 'width geo)))
154 (if (or height width)
155 (setq default-frame-alist
156 (append default-frame-alist
bfabe882
RS
157 '((user-size . t))
158 (if height (list height))
159 (if width (list width)))
160 initial-frame-alist
161 (append initial-frame-alist
ea8d3061
RS
162 '((user-size . t))
163 (if height (list height))
164 (if width (list width)))))
165 (if (or left top)
166 (setq initial-frame-alist
167 (append initial-frame-alist
168 '((user-position . t))
169 (if left (list left))
170 (if top (list top)))))
171 (setq x-invocation-args (cdr x-invocation-args))))
63f77899 172
66f229be
RS
173;; Handle the -name option. Set the variable x-resource-name
174;; to the option's operand; set the name of
800642d2 175;; the initial frame, too.
66f229be 176(defun x-handle-name-switch (switch)
800642d2
JB
177 (or (consp x-invocation-args)
178 (error "%s: missing argument to `%s' option" (invocation-name) switch))
179 (setq x-resource-name (car x-invocation-args)
180 x-invocation-args (cdr x-invocation-args))
66f229be
RS
181 (setq initial-frame-alist (cons (cons 'name x-resource-name)
182 initial-frame-alist)))
800642d2 183
63f77899 184(defvar x-display-name nil
6f6c5fb3
CY
185 "The name of the X display on which Emacs was started.
186
366f1741 187For the X display name of individual frames, see the `display'
6f6c5fb3 188frame parameter.")
63f77899
JB
189
190(defun x-handle-display (switch)
e50f1c1a 191 "Handle -display DISPLAY option."
63f77899 192 (setq x-display-name (car x-invocation-args)
d98f0b87
RS
193 x-invocation-args (cdr x-invocation-args))
194 ;; Make subshell programs see the same DISPLAY value Emacs really uses.
195 ;; Note that this isn't completely correct, since Emacs can use
196 ;; multiple displays. However, there is no way to tell an already
197 ;; running subshell which display the user is currently typing on.
198 (setenv "DISPLAY" x-display-name))
63f77899 199
8769d648 200(defun x-handle-args (args)
dc20df95
RS
201 "Process the X-related command line options in ARGS.
202This is done before the user's startup file is loaded. They are copied to
80128ceb 203`x-invocation-args', from which the X-related things are extracted, first
8769d648 204the switch (e.g., \"-fg\") in the following code, and possible values
a4e104bf 205\(e.g., \"black\") in the option handler code (e.g., x-handle-switch).
80128ceb
RS
206This function returns ARGS minus the arguments that have been processed."
207 ;; We use ARGS to accumulate the args that we don't handle here, to return.
63c86e17
JB
208 (setq x-invocation-args args
209 args nil)
0dd96d4c
RS
210 (while (and x-invocation-args
211 (not (equal (car x-invocation-args) "--")))
63c86e17 212 (let* ((this-switch (car x-invocation-args))
e491912f 213 (orig-this-switch this-switch)
80128ceb 214 completion argval aelt handler)
63c86e17 215 (setq x-invocation-args (cdr x-invocation-args))
e491912f
RS
216 ;; Check for long options with attached arguments
217 ;; and separate out the attached option argument into argval.
218 (if (string-match "^--[^=]*=" this-switch)
219 (setq argval (substring this-switch (match-end 0))
220 this-switch (substring this-switch 0 (1- (match-end 0)))))
80128ceb
RS
221 ;; Complete names of long options.
222 (if (string-match "^--" this-switch)
223 (progn
224 (setq completion (try-completion this-switch command-line-x-option-alist))
225 (if (eq completion t)
226 ;; Exact match for long option.
227 nil
228 (if (stringp completion)
229 (let ((elt (assoc completion command-line-x-option-alist)))
230 ;; Check for abbreviated long option.
231 (or elt
232 (error "Option `%s' is ambiguous" this-switch))
233 (setq this-switch completion))))))
234 (setq aelt (assoc this-switch command-line-x-option-alist))
235 (if aelt (setq handler (nth 2 aelt)))
236 (if handler
e491912f
RS
237 (if argval
238 (let ((x-invocation-args
239 (cons argval x-invocation-args)))
80128ceb
RS
240 (funcall handler this-switch))
241 (funcall handler this-switch))
242 (setq args (cons orig-this-switch args)))))
0dd96d4c 243 (nconc (nreverse args) x-invocation-args))
941a391a
JD
244
245;; Handle the --smid switch. This is used by the session manager
246;; to give us back our session id we had on the previous run.
247(defun x-handle-smid (switch)
248 (or (consp x-invocation-args)
249 (error "%s: missing argument to `%s' option" (invocation-name) switch))
250 (setq x-session-previous-id (car x-invocation-args)
251 x-invocation-args (cdr x-invocation-args)))
252
253(defvar emacs-save-session-functions nil
c3ef5084
SM
254 "Special hook run when a save-session event occurs.
255The functions do not get any argument.
941a391a
JD
256Functions can return non-nil to inform the session manager that the
257window system shutdown should be aborted.
258
259See also `emacs-session-save'.")
260
261(defun emacs-session-filename (session-id)
262 "Construct a filename to save the session in based on SESSION-ID.
263If the directory ~/.emacs.d exists, we make a filename in there, otherwise
264a file in the home directory."
265 (let ((basename (concat "session." session-id))
266 (emacs-dir "~/.emacs.d/"))
267 (expand-file-name (if (file-directory-p emacs-dir)
268 (concat emacs-dir basename)
269 (concat "~/.emacs-" basename)))))
db95369b 270
941a391a
JD
271(defun emacs-session-save ()
272 "This function is called when the window system is shutting down.
273If this function returns non-nil, the window system shutdown is cancelled.
274
275When a session manager tells Emacs that the window system is shutting
276down, this function is called. It calls the functions in the hook
277`emacs-save-session-functions'. Functions are called with the current
278buffer set to a temporary buffer. Functions should use `insert' to insert
279lisp code to save the session state. The buffer is saved
280in a file in the home directory of the user running Emacs. The file
281is evaluated when Emacs is restarted by the session manager.
282
283If any of the functions returns non-nil, no more functions are called
284and this function returns non-nil. This will inform the session manager
285that it should abort the window system shutdown."
286 (let ((filename (emacs-session-filename x-session-id))
287 (buf (get-buffer-create (concat " *SES " x-session-id))))
288 (when (file-exists-p filename)
289 (delete-file filename))
290 (with-current-buffer buf
291 (let ((cancel-shutdown (condition-case nil
3842fde1 292 ;; A return of t means cancel the shutdown.
db95369b 293 (run-hook-with-args-until-success
941a391a
JD
294 'emacs-save-session-functions)
295 (error t))))
296 (unless cancel-shutdown
297 (write-file filename))
298 (kill-buffer buf)
299 cancel-shutdown))))
300
1e4f6cec 301(defun emacs-session-restore (previous-session-id)
941a391a
JD
302 "Restore the Emacs session if started by a session manager.
303The file saved by `emacs-session-save' is evaluated and deleted if it
304exists."
1e4f6cec 305 (let ((filename (emacs-session-filename previous-session-id)))
941a391a
JD
306 (when (file-exists-p filename)
307 (load-file filename)
308 (delete-file filename)
309 (message "Restored session data"))))
310
db95369b
JB
311
312
63f77899
JB
313\f
314;;
315;; Standard X cursor shapes, courtesy of Mr. Fox, who wanted ALL of them.
316;;
317
318(defconst x-pointer-X-cursor 0)
319(defconst x-pointer-arrow 2)
320(defconst x-pointer-based-arrow-down 4)
321(defconst x-pointer-based-arrow-up 6)
322(defconst x-pointer-boat 8)
323(defconst x-pointer-bogosity 10)
324(defconst x-pointer-bottom-left-corner 12)
325(defconst x-pointer-bottom-right-corner 14)
326(defconst x-pointer-bottom-side 16)
327(defconst x-pointer-bottom-tee 18)
328(defconst x-pointer-box-spiral 20)
329(defconst x-pointer-center-ptr 22)
330(defconst x-pointer-circle 24)
331(defconst x-pointer-clock 26)
332(defconst x-pointer-coffee-mug 28)
333(defconst x-pointer-cross 30)
334(defconst x-pointer-cross-reverse 32)
335(defconst x-pointer-crosshair 34)
336(defconst x-pointer-diamond-cross 36)
337(defconst x-pointer-dot 38)
338(defconst x-pointer-dotbox 40)
339(defconst x-pointer-double-arrow 42)
340(defconst x-pointer-draft-large 44)
341(defconst x-pointer-draft-small 46)
342(defconst x-pointer-draped-box 48)
343(defconst x-pointer-exchange 50)
344(defconst x-pointer-fleur 52)
345(defconst x-pointer-gobbler 54)
346(defconst x-pointer-gumby 56)
347(defconst x-pointer-hand1 58)
348(defconst x-pointer-hand2 60)
349(defconst x-pointer-heart 62)
350(defconst x-pointer-icon 64)
351(defconst x-pointer-iron-cross 66)
352(defconst x-pointer-left-ptr 68)
353(defconst x-pointer-left-side 70)
354(defconst x-pointer-left-tee 72)
355(defconst x-pointer-leftbutton 74)
356(defconst x-pointer-ll-angle 76)
357(defconst x-pointer-lr-angle 78)
358(defconst x-pointer-man 80)
359(defconst x-pointer-middlebutton 82)
360(defconst x-pointer-mouse 84)
361(defconst x-pointer-pencil 86)
362(defconst x-pointer-pirate 88)
363(defconst x-pointer-plus 90)
364(defconst x-pointer-question-arrow 92)
365(defconst x-pointer-right-ptr 94)
366(defconst x-pointer-right-side 96)
367(defconst x-pointer-right-tee 98)
368(defconst x-pointer-rightbutton 100)
369(defconst x-pointer-rtl-logo 102)
370(defconst x-pointer-sailboat 104)
371(defconst x-pointer-sb-down-arrow 106)
372(defconst x-pointer-sb-h-double-arrow 108)
373(defconst x-pointer-sb-left-arrow 110)
374(defconst x-pointer-sb-right-arrow 112)
375(defconst x-pointer-sb-up-arrow 114)
376(defconst x-pointer-sb-v-double-arrow 116)
377(defconst x-pointer-shuttle 118)
378(defconst x-pointer-sizing 120)
379(defconst x-pointer-spider 122)
380(defconst x-pointer-spraycan 124)
381(defconst x-pointer-star 126)
382(defconst x-pointer-target 128)
383(defconst x-pointer-tcross 130)
384(defconst x-pointer-top-left-arrow 132)
385(defconst x-pointer-top-left-corner 134)
386(defconst x-pointer-top-right-corner 136)
387(defconst x-pointer-top-side 138)
388(defconst x-pointer-top-tee 140)
389(defconst x-pointer-trek 142)
390(defconst x-pointer-ul-angle 144)
391(defconst x-pointer-umbrella 146)
392(defconst x-pointer-ur-angle 148)
393(defconst x-pointer-watch 150)
394(defconst x-pointer-xterm 152)
395\f
396;;
397;; Available colors
398;;
399
38fb1ad4
GM
400(defvar x-colors '("LightGreen"
401 "light green"
402 "DarkRed"
403 "dark red"
404 "DarkMagenta"
405 "dark magenta"
406 "DarkCyan"
407 "dark cyan"
408 "DarkBlue"
409 "dark blue"
410 "DarkGray"
411 "dark gray"
412 "DarkGrey"
413 "dark grey"
414 "grey100"
415 "gray100"
416 "grey99"
417 "gray99"
418 "grey98"
419 "gray98"
420 "grey97"
421 "gray97"
422 "grey96"
423 "gray96"
424 "grey95"
425 "gray95"
426 "grey94"
427 "gray94"
428 "grey93"
429 "gray93"
430 "grey92"
431 "gray92"
432 "grey91"
433 "gray91"
434 "grey90"
435 "gray90"
436 "grey89"
437 "gray89"
438 "grey88"
439 "gray88"
440 "grey87"
441 "gray87"
442 "grey86"
443 "gray86"
444 "grey85"
445 "gray85"
446 "grey84"
447 "gray84"
448 "grey83"
449 "gray83"
450 "grey82"
451 "gray82"
452 "grey81"
453 "gray81"
454 "grey80"
455 "gray80"
456 "grey79"
457 "gray79"
458 "grey78"
459 "gray78"
460 "grey77"
461 "gray77"
462 "grey76"
463 "gray76"
464 "grey75"
465 "gray75"
466 "grey74"
467 "gray74"
468 "grey73"
469 "gray73"
470 "grey72"
471 "gray72"
472 "grey71"
473 "gray71"
474 "grey70"
475 "gray70"
476 "grey69"
477 "gray69"
478 "grey68"
479 "gray68"
480 "grey67"
481 "gray67"
482 "grey66"
483 "gray66"
484 "grey65"
485 "gray65"
486 "grey64"
487 "gray64"
488 "grey63"
489 "gray63"
490 "grey62"
491 "gray62"
492 "grey61"
493 "gray61"
494 "grey60"
495 "gray60"
496 "grey59"
497 "gray59"
498 "grey58"
499 "gray58"
500 "grey57"
501 "gray57"
502 "grey56"
503 "gray56"
504 "grey55"
505 "gray55"
506 "grey54"
507 "gray54"
508 "grey53"
509 "gray53"
510 "grey52"
511 "gray52"
512 "grey51"
513 "gray51"
514 "grey50"
515 "gray50"
516 "grey49"
517 "gray49"
518 "grey48"
519 "gray48"
520 "grey47"
521 "gray47"
522 "grey46"
523 "gray46"
524 "grey45"
525 "gray45"
526 "grey44"
527 "gray44"
528 "grey43"
529 "gray43"
530 "grey42"
531 "gray42"
532 "grey41"
533 "gray41"
534 "grey40"
535 "gray40"
536 "grey39"
537 "gray39"
538 "grey38"
539 "gray38"
540 "grey37"
541 "gray37"
542 "grey36"
543 "gray36"
544 "grey35"
545 "gray35"
546 "grey34"
547 "gray34"
548 "grey33"
549 "gray33"
550 "grey32"
551 "gray32"
552 "grey31"
553 "gray31"
554 "grey30"
555 "gray30"
556 "grey29"
557 "gray29"
558 "grey28"
559 "gray28"
560 "grey27"
561 "gray27"
562 "grey26"
563 "gray26"
564 "grey25"
565 "gray25"
566 "grey24"
567 "gray24"
568 "grey23"
569 "gray23"
570 "grey22"
571 "gray22"
572 "grey21"
573 "gray21"
574 "grey20"
575 "gray20"
576 "grey19"
577 "gray19"
578 "grey18"
579 "gray18"
580 "grey17"
581 "gray17"
582 "grey16"
583 "gray16"
584 "grey15"
585 "gray15"
586 "grey14"
587 "gray14"
588 "grey13"
589 "gray13"
590 "grey12"
591 "gray12"
592 "grey11"
593 "gray11"
594 "grey10"
595 "gray10"
596 "grey9"
597 "gray9"
598 "grey8"
599 "gray8"
600 "grey7"
601 "gray7"
602 "grey6"
603 "gray6"
604 "grey5"
605 "gray5"
606 "grey4"
607 "gray4"
608 "grey3"
609 "gray3"
610 "grey2"
611 "gray2"
612 "grey1"
613 "gray1"
614 "grey0"
615 "gray0"
616 "thistle4"
617 "thistle3"
618 "thistle2"
619 "thistle1"
620 "MediumPurple4"
621 "MediumPurple3"
622 "MediumPurple2"
623 "MediumPurple1"
624 "purple4"
625 "purple3"
626 "purple2"
627 "purple1"
628 "DarkOrchid4"
629 "DarkOrchid3"
630 "DarkOrchid2"
631 "DarkOrchid1"
632 "MediumOrchid4"
633 "MediumOrchid3"
634 "MediumOrchid2"
635 "MediumOrchid1"
636 "plum4"
637 "plum3"
638 "plum2"
639 "plum1"
640 "orchid4"
641 "orchid3"
642 "orchid2"
643 "orchid1"
644 "magenta4"
645 "magenta3"
646 "magenta2"
647 "magenta1"
648 "VioletRed4"
649 "VioletRed3"
650 "VioletRed2"
651 "VioletRed1"
652 "maroon4"
653 "maroon3"
654 "maroon2"
655 "maroon1"
656 "PaleVioletRed4"
657 "PaleVioletRed3"
658 "PaleVioletRed2"
659 "PaleVioletRed1"
660 "LightPink4"
661 "LightPink3"
662 "LightPink2"
663 "LightPink1"
664 "pink4"
665 "pink3"
666 "pink2"
667 "pink1"
668 "HotPink4"
669 "HotPink3"
670 "HotPink2"
671 "HotPink1"
672 "DeepPink4"
673 "DeepPink3"
674 "DeepPink2"
675 "DeepPink1"
676 "red4"
677 "red3"
678 "red2"
679 "red1"
680 "OrangeRed4"
681 "OrangeRed3"
682 "OrangeRed2"
683 "OrangeRed1"
684 "tomato4"
685 "tomato3"
686 "tomato2"
687 "tomato1"
688 "coral4"
689 "coral3"
690 "coral2"
691 "coral1"
692 "DarkOrange4"
693 "DarkOrange3"
694 "DarkOrange2"
695 "DarkOrange1"
696 "orange4"
697 "orange3"
698 "orange2"
699 "orange1"
700 "LightSalmon4"
701 "LightSalmon3"
702 "LightSalmon2"
703 "LightSalmon1"
704 "salmon4"
705 "salmon3"
706 "salmon2"
707 "salmon1"
708 "brown4"
709 "brown3"
710 "brown2"
711 "brown1"
712 "firebrick4"
713 "firebrick3"
714 "firebrick2"
715 "firebrick1"
716 "chocolate4"
717 "chocolate3"
718 "chocolate2"
719 "chocolate1"
720 "tan4"
721 "tan3"
722 "tan2"
723 "tan1"
724 "wheat4"
725 "wheat3"
726 "wheat2"
727 "wheat1"
728 "burlywood4"
729 "burlywood3"
730 "burlywood2"
731 "burlywood1"
732 "sienna4"
733 "sienna3"
734 "sienna2"
735 "sienna1"
736 "IndianRed4"
737 "IndianRed3"
738 "IndianRed2"
739 "IndianRed1"
740 "RosyBrown4"
741 "RosyBrown3"
742 "RosyBrown2"
743 "RosyBrown1"
744 "DarkGoldenrod4"
745 "DarkGoldenrod3"
746 "DarkGoldenrod2"
747 "DarkGoldenrod1"
748 "goldenrod4"
749 "goldenrod3"
750 "goldenrod2"
751 "goldenrod1"
752 "gold4"
753 "gold3"
754 "gold2"
755 "gold1"
756 "yellow4"
757 "yellow3"
758 "yellow2"
759 "yellow1"
760 "LightYellow4"
761 "LightYellow3"
762 "LightYellow2"
763 "LightYellow1"
764 "LightGoldenrod4"
765 "LightGoldenrod3"
766 "LightGoldenrod2"
767 "LightGoldenrod1"
768 "khaki4"
769 "khaki3"
770 "khaki2"
771 "khaki1"
772 "DarkOliveGreen4"
773 "DarkOliveGreen3"
774 "DarkOliveGreen2"
775 "DarkOliveGreen1"
776 "OliveDrab4"
777 "OliveDrab3"
778 "OliveDrab2"
779 "OliveDrab1"
780 "chartreuse4"
781 "chartreuse3"
782 "chartreuse2"
783 "chartreuse1"
784 "green4"
785 "green3"
786 "green2"
787 "green1"
788 "SpringGreen4"
789 "SpringGreen3"
790 "SpringGreen2"
791 "SpringGreen1"
792 "PaleGreen4"
793 "PaleGreen3"
794 "PaleGreen2"
795 "PaleGreen1"
796 "SeaGreen4"
797 "SeaGreen3"
798 "SeaGreen2"
799 "SeaGreen1"
800 "DarkSeaGreen4"
801 "DarkSeaGreen3"
802 "DarkSeaGreen2"
803 "DarkSeaGreen1"
804 "aquamarine4"
805 "aquamarine3"
806 "aquamarine2"
807 "aquamarine1"
808 "DarkSlateGray4"
809 "DarkSlateGray3"
810 "DarkSlateGray2"
811 "DarkSlateGray1"
812 "cyan4"
813 "cyan3"
814 "cyan2"
815 "cyan1"
816 "turquoise4"
817 "turquoise3"
818 "turquoise2"
819 "turquoise1"
820 "CadetBlue4"
821 "CadetBlue3"
822 "CadetBlue2"
823 "CadetBlue1"
824 "PaleTurquoise4"
825 "PaleTurquoise3"
826 "PaleTurquoise2"
827 "PaleTurquoise1"
828 "LightCyan4"
829 "LightCyan3"
830 "LightCyan2"
831 "LightCyan1"
832 "LightBlue4"
833 "LightBlue3"
834 "LightBlue2"
835 "LightBlue1"
836 "LightSteelBlue4"
837 "LightSteelBlue3"
838 "LightSteelBlue2"
839 "LightSteelBlue1"
840 "SlateGray4"
841 "SlateGray3"
842 "SlateGray2"
843 "SlateGray1"
844 "LightSkyBlue4"
845 "LightSkyBlue3"
846 "LightSkyBlue2"
847 "LightSkyBlue1"
848 "SkyBlue4"
849 "SkyBlue3"
850 "SkyBlue2"
851 "SkyBlue1"
852 "DeepSkyBlue4"
853 "DeepSkyBlue3"
854 "DeepSkyBlue2"
855 "DeepSkyBlue1"
856 "SteelBlue4"
857 "SteelBlue3"
858 "SteelBlue2"
859 "SteelBlue1"
860 "DodgerBlue4"
861 "DodgerBlue3"
862 "DodgerBlue2"
863 "DodgerBlue1"
864 "blue4"
865 "blue3"
866 "blue2"
867 "blue1"
868 "RoyalBlue4"
869 "RoyalBlue3"
870 "RoyalBlue2"
871 "RoyalBlue1"
872 "SlateBlue4"
873 "SlateBlue3"
874 "SlateBlue2"
875 "SlateBlue1"
876 "azure4"
877 "azure3"
878 "azure2"
879 "azure1"
880 "MistyRose4"
881 "MistyRose3"
882 "MistyRose2"
883 "MistyRose1"
884 "LavenderBlush4"
885 "LavenderBlush3"
886 "LavenderBlush2"
887 "LavenderBlush1"
888 "honeydew4"
889 "honeydew3"
890 "honeydew2"
891 "honeydew1"
892 "ivory4"
893 "ivory3"
894 "ivory2"
895 "ivory1"
896 "cornsilk4"
897 "cornsilk3"
898 "cornsilk2"
899 "cornsilk1"
900 "LemonChiffon4"
901 "LemonChiffon3"
902 "LemonChiffon2"
903 "LemonChiffon1"
904 "NavajoWhite4"
905 "NavajoWhite3"
906 "NavajoWhite2"
907 "NavajoWhite1"
908 "PeachPuff4"
909 "PeachPuff3"
910 "PeachPuff2"
911 "PeachPuff1"
912 "bisque4"
913 "bisque3"
914 "bisque2"
915 "bisque1"
916 "AntiqueWhite4"
917 "AntiqueWhite3"
918 "AntiqueWhite2"
919 "AntiqueWhite1"
920 "seashell4"
921 "seashell3"
922 "seashell2"
923 "seashell1"
924 "snow4"
925 "snow3"
926 "snow2"
927 "snow1"
928 "thistle"
929 "MediumPurple"
930 "medium purple"
931 "purple"
932 "BlueViolet"
933 "blue violet"
934 "DarkViolet"
935 "dark violet"
936 "DarkOrchid"
937 "dark orchid"
938 "MediumOrchid"
939 "medium orchid"
940 "orchid"
941 "plum"
942 "violet"
943 "magenta"
944 "VioletRed"
945 "violet red"
946 "MediumVioletRed"
947 "medium violet red"
948 "maroon"
949 "PaleVioletRed"
950 "pale violet red"
951 "LightPink"
952 "light pink"
953 "pink"
954 "DeepPink"
955 "deep pink"
956 "HotPink"
957 "hot pink"
958 "red"
959 "OrangeRed"
960 "orange red"
961 "tomato"
962 "LightCoral"
963 "light coral"
63f77899 964 "coral"
38fb1ad4
GM
965 "DarkOrange"
966 "dark orange"
967 "orange"
968 "LightSalmon"
969 "light salmon"
970 "salmon"
971 "DarkSalmon"
972 "dark salmon"
63f77899 973 "brown"
38fb1ad4
GM
974 "firebrick"
975 "chocolate"
976 "tan"
977 "SandyBrown"
978 "sandy brown"
979 "wheat"
980 "beige"
981 "burlywood"
982 "peru"
983 "sienna"
984 "SaddleBrown"
985 "saddle brown"
986 "IndianRed"
987 "indian red"
988 "RosyBrown"
989 "rosy brown"
990 "DarkGoldenrod"
991 "dark goldenrod"
63f77899 992 "goldenrod"
38fb1ad4
GM
993 "LightGoldenrod"
994 "light goldenrod"
995 "gold"
996 "yellow"
997 "LightYellow"
998 "light yellow"
999 "LightGoldenrodYellow"
1000 "light goldenrod yellow"
1001 "PaleGoldenrod"
1002 "pale goldenrod"
1003 "khaki"
1004 "DarkKhaki"
1005 "dark khaki"
1006 "OliveDrab"
1007 "olive drab"
63f77899 1008 "ForestGreen"
38fb1ad4
GM
1009 "forest green"
1010 "YellowGreen"
1011 "yellow green"
63f77899 1012 "LimeGreen"
38fb1ad4
GM
1013 "lime green"
1014 "GreenYellow"
1015 "green yellow"
63f77899 1016 "MediumSpringGreen"
38fb1ad4
GM
1017 "medium spring green"
1018 "chartreuse"
1019 "green"
1020 "LawnGreen"
1021 "lawn green"
1022 "SpringGreen"
1023 "spring green"
63f77899 1024 "PaleGreen"
38fb1ad4
GM
1025 "pale green"
1026 "LightSeaGreen"
1027 "light sea green"
1028 "MediumSeaGreen"
1029 "medium sea green"
63f77899 1030 "SeaGreen"
38fb1ad4
GM
1031 "sea green"
1032 "DarkSeaGreen"
1033 "dark sea green"
1034 "DarkOliveGreen"
1035 "dark olive green"
1036 "DarkGreen"
1037 "dark green"
1038 "aquamarine"
1039 "MediumAquamarine"
1040 "medium aquamarine"
1041 "CadetBlue"
1042 "cadet blue"
1043 "LightCyan"
1044 "light cyan"
1045 "cyan"
63f77899 1046 "turquoise"
63f77899 1047 "MediumTurquoise"
38fb1ad4
GM
1048 "medium turquoise"
1049 "DarkTurquoise"
1050 "dark turquoise"
1051 "PaleTurquoise"
1052 "pale turquoise"
1053 "PowderBlue"
1054 "powder blue"
1055 "LightBlue"
1056 "light blue"
1057 "LightSteelBlue"
1058 "light steel blue"
1059 "SteelBlue"
1060 "steel blue"
1061 "LightSkyBlue"
1062 "light sky blue"
1063 "SkyBlue"
1064 "sky blue"
1065 "DeepSkyBlue"
1066 "deep sky blue"
1067 "DodgerBlue"
1068 "dodger blue"
1069 "blue"
1070 "RoyalBlue"
1071 "royal blue"
1072 "MediumBlue"
1073 "medium blue"
1074 "LightSlateBlue"
1075 "light slate blue"
1076 "MediumSlateBlue"
1077 "medium slate blue"
1078 "SlateBlue"
1079 "slate blue"
1080 "DarkSlateBlue"
1081 "dark slate blue"
1082 "CornflowerBlue"
1083 "cornflower blue"
1084 "NavyBlue"
1085 "navy blue"
1086 "navy"
1087 "MidnightBlue"
1088 "midnight blue"
1089 "LightGray"
1090 "light gray"
1091 "LightGrey"
1092 "light grey"
1093 "grey"
1094 "gray"
1095 "LightSlateGrey"
1096 "light slate grey"
1097 "LightSlateGray"
1098 "light slate gray"
1099 "SlateGrey"
1100 "slate grey"
1101 "SlateGray"
1102 "slate gray"
1103 "DimGrey"
1104 "dim grey"
1105 "DimGray"
1106 "dim gray"
1107 "DarkSlateGrey"
1108 "dark slate grey"
1109 "DarkSlateGray"
1110 "dark slate gray"
1111 "black"
63f77899 1112 "white"
38fb1ad4
GM
1113 "MistyRose"
1114 "misty rose"
1115 "LavenderBlush"
1116 "lavender blush"
1117 "lavender"
1118 "AliceBlue"
1119 "alice blue"
1120 "azure"
1121 "MintCream"
1122 "mint cream"
1123 "honeydew"
1124 "seashell"
1125 "LemonChiffon"
1126 "lemon chiffon"
1127 "ivory"
1128 "cornsilk"
1129 "moccasin"
1130 "NavajoWhite"
1131 "navajo white"
1132 "PeachPuff"
1133 "peach puff"
1134 "bisque"
1135 "BlanchedAlmond"
1136 "blanched almond"
1137 "PapayaWhip"
1138 "papaya whip"
1139 "AntiqueWhite"
1140 "antique white"
1141 "linen"
1142 "OldLace"
1143 "old lace"
1144 "FloralWhite"
1145 "floral white"
1146 "gainsboro"
1147 "WhiteSmoke"
1148 "white smoke"
1149 "GhostWhite"
1150 "ghost white"
1151 "snow")
1152 "The list of X colors from the `rgb.txt' file.
1153XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
63f77899 1154
f795f633
EZ
1155(defun xw-defined-colors (&optional frame)
1156 "Internal function called by `defined-colors', which see."
891eb3fe 1157 (or frame (setq frame (selected-frame)))
63f77899
JB
1158 (let ((all-colors x-colors)
1159 (this-color nil)
1160 (defined-colors nil))
1161 (while all-colors
1162 (setq this-color (car all-colors)
1163 all-colors (cdr all-colors))
79b24da3 1164 (and (color-supported-p this-color frame t)
63f77899
JB
1165 (setq defined-colors (cons this-color defined-colors))))
1166 defined-colors))
63f77899 1167\f
98bf0c8d
JB
1168;;;; Function keys
1169
2d7bfcc3
RS
1170(substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame
1171 global-map)
e9de784c 1172
3d80ef3f
RS
1173;; Map certain keypad keys into ASCII characters
1174;; that people usually expect.
1175(define-key function-key-map [backspace] [127])
1176(define-key function-key-map [delete] [127])
1177(define-key function-key-map [tab] [?\t])
1178(define-key function-key-map [linefeed] [?\n])
b8e9a326
RS
1179(define-key function-key-map [clear] [?\C-l])
1180(define-key function-key-map [return] [?\C-m])
3d80ef3f
RS
1181(define-key function-key-map [escape] [?\e])
1182(define-key function-key-map [M-backspace] [?\M-\d])
1183(define-key function-key-map [M-delete] [?\M-\d])
1184(define-key function-key-map [M-tab] [?\M-\t])
1185(define-key function-key-map [M-linefeed] [?\M-\n])
b8e9a326
RS
1186(define-key function-key-map [M-clear] [?\M-\C-l])
1187(define-key function-key-map [M-return] [?\M-\C-m])
3d80ef3f 1188(define-key function-key-map [M-escape] [?\M-\e])
87c033db 1189(define-key function-key-map [iso-lefttab] [backtab])
8f96b49b 1190(define-key function-key-map [S-iso-lefttab] [backtab])
3d80ef3f
RS
1191
1192;; These tell read-char how to convert
1193;; these special chars to ASCII.
1194(put 'backspace 'ascii-character 127)
1195(put 'delete 'ascii-character 127)
1196(put 'tab 'ascii-character ?\t)
1197(put 'linefeed 'ascii-character ?\n)
1198(put 'clear 'ascii-character 12)
1199(put 'return 'ascii-character 13)
1200(put 'escape 'ascii-character ?\e)
afa43349 1201
cf07d2bd
DL
1202\f
1203;;;; Keysyms
1204
9b4234ae 1205(defun vendor-specific-keysyms (vendor)
089bc712 1206 "Return the appropriate value of `system-key-alist' for VENDOR.
9b4234ae 1207VENDOR is a string containing the name of the X Server's vendor,
089bc712 1208as returned by `x-server-vendor'."
cf07d2bd 1209 ;; Fixme: Drop Apollo now?
9b4234ae
RS
1210 (cond ((string-equal vendor "Apollo Computer Inc.")
1211 '((65280 . linedel)
1212 (65281 . chardel)
1213 (65282 . copy)
1214 (65283 . cut)
1215 (65284 . paste)
1216 (65285 . move)
1217 (65286 . grow)
1218 (65287 . cmd)
1219 (65288 . shell)
1220 (65289 . leftbar)
1221 (65290 . rightbar)
1222 (65291 . leftbox)
1223 (65292 . rightbox)
1224 (65293 . upbox)
1225 (65294 . downbox)
1226 (65295 . pop)
1227 (65296 . read)
1228 (65297 . edit)
1229 (65298 . save)
1230 (65299 . exit)
1231 (65300 . repeat)))
3f18a142
KH
1232 ((or (string-equal vendor "Hewlett-Packard Incorporated")
1233 (string-equal vendor "Hewlett-Packard Company"))
9b4234ae
RS
1234 '(( 168 . mute-acute)
1235 ( 169 . mute-grave)
1236 ( 170 . mute-asciicircum)
1237 ( 171 . mute-diaeresis)
1238 ( 172 . mute-asciitilde)
1239 ( 175 . lira)
1240 ( 190 . guilder)
1241 ( 252 . block)
1242 ( 256 . longminus)
1243 (65388 . reset)
1244 (65389 . system)
1245 (65390 . user)
1246 (65391 . clearline)
1247 (65392 . insertline)
1248 (65393 . deleteline)
1249 (65394 . insertchar)
1250 (65395 . deletechar)
1251 (65396 . backtab)
1252 (65397 . kp-backtab)))
cf07d2bd 1253 ;; Fixme: What about non-X11/NeWS sun server?
04486a2d
KH
1254 ((or (string-equal vendor "X11/NeWS - Sun Microsystems Inc.")
1255 (string-equal vendor "X Consortium"))
51a8e1cc
KH
1256 '((392976 . f36)
1257 (392977 . f37)
9b4234ae
RS
1258 (393056 . req)
1259 ;; These are for Sun under X11R6
1260 (393072 . props)
1261 (393073 . front)
1262 (393074 . copy)
1263 (393075 . open)
1264 (393076 . paste)
1265 (393077 . cut)))
1266 (t
1267 ;; This is used by DEC's X server.
1268 '((65280 . remove)))))
1269
cf07d2bd
DL
1270(let ((i 160))
1271 (while (< i 256)
1272 (puthash i (make-char 'latin-iso8859-1 i) x-keysym-table)
1273 (setq i (1+ i))))
1274
1275;; Table from Kuhn's proposed additions to the `KEYSYM Encoding'
1276;; appendix to the X protocol definition.
1277(dolist
1278 (pair
1279 '(
1280 ;; Latin-2
1281 (#x1a1 . ?\e,B!\e(B)
1282 (#x1a2 . ?\e,B"\e(B)
1283 (#x1a3 . ?\e,B#\e(B)
1284 (#x1a5 . ?\e,B%\e(B)
1285 (#x1a6 . ?\e,B&\e(B)
1286 (#x1a9 . ?\e,B)\e(B)
1287 (#x1aa . ?\e,B*\e(B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 (#x1f2 . ?\e,Br\e(B)
1332 (#x1f5 . ?\e,Bu\e(B)
1333 (#x1f8 . ?\e,Bx\e(B)
1334 (#x1f9 . ?\e,By\e(B)
1335 (#x1fb . ?\e,B{\e(B)
1336 (#x1fe . ?\e,B~\e(B)
1337 (#x1ff . ?\e,B\7f\e(B)
1338 ;; Latin-3
1339 (#x2a1 . ?\e,C!\e(B)
1340 (#x2a6 . ?\e,C&\e(B)
1341 (#x2a9 . ?\e,C)\e(B)
1342 (#x2ab . ?\e,C+\e(B)
1343 (#x2ac . ?\e,C,\e(B)
1344 (#x2b1 . ?\e,C1\e(B)
1345 (#x2b6 . ?\e,C6\e(B)
1346 (#x2b9 . ?\e,C9\e(B)
1347 (#x2bb . ?\e,C;\e(B)
1348 (#x2bc . ?\e,C<\e(B)
1349 (#x2c5 . ?\e,CE\e(B)
1350 (#x2c6 . ?\e,CF\e(B)
1351 (#x2d5 . ?\e,CU\e(B)
1352 (#x2d8 . ?\e,CX\e(B)
1353 (#x2dd . ?\e,C]\e(B)
1354 (#x2de . ?\e,C^\e(B)
1355 (#x2e5 . ?\e,Ce\e(B)
1356 (#x2e6 . ?\e,Cf\e(B)
1357 (#x2f5 . ?\e,Cu\e(B)
1358 (#x2f8 . ?\e,Cx\e(B)
1359 (#x2fd . ?\e,C}\e(B)
1360 (#x2fe . ?\e,C~\e(B)
1361 ;; Latin-4
1362 (#x3a2 . ?\e,D"\e(B)
1363 (#x3a3 . ?\e,D#\e(B)
1364 (#x3a5 . ?\e,D%\e(B)
1365 (#x3a6 . ?\e,D&\e(B)
1366 (#x3aa . ?\e,D*\e(B)
1367 (#x3ab . ?\e,D+\e(B)
1368 (#x3ac . ?\e,D,\e(B)
1369 (#x3b3 . ?\e,D3\e(B)
1370 (#x3b5 . ?\e,D5\e(B)
1371 (#x3b6 . ?\e,D6\e(B)
1372 (#x3ba . ?\e,D:\e(B)
1373 (#x3bb . ?\e,D;\e(B)
1374 (#x3bc . ?\e,D<\e(B)
1375 (#x3bd . ?\e,D=\e(B)
1376 (#x3bf . ?\e,D?\e(B)
1377 (#x3c0 . ?\e,D@\e(B)
1378 (#x3c7 . ?\e,DG\e(B)
1379 (#x3cc . ?\e,DL\e(B)
1380 (#x3cf . ?\e,DO\e(B)
1381 (#x3d1 . ?\e,DQ\e(B)
1382 (#x3d2 . ?\e,DR\e(B)
1383 (#x3d3 . ?\e,DS\e(B)
1384 (#x3d9 . ?\e,DY\e(B)
1385 (#x3dd . ?\e,D]\e(B)
1386 (#x3de . ?\e,D^\e(B)
1387 (#x3e0 . ?\e,D`\e(B)
1388 (#x3e7 . ?\e,Dg\e(B)
1389 (#x3ec . ?\e,Dl\e(B)
1390 (#x3ef . ?\e,Do\e(B)
1391 (#x3f1 . ?\e,Dq\e(B)
1392 (#x3f2 . ?\e,Dr\e(B)
1393 (#x3f3 . ?\e,Ds\e(B)
1394 (#x3f9 . ?\e,Dy\e(B)
1395 (#x3fd . ?\e,D}\e(B)
1396 (#x3fe . ?\e,D~\e(B)
1397 ;; Kana: Fixme: needs conversion to Japanese charset -- seems
1398 ;; to require jisx0213, for which the Unicode translation
1399 ;; isn't clear.
1400 (#x47e . ?\e$,1s>\e(B)
1401 (#x4a1 . ?\e$,2=B\e(B)
1402 (#x4a2 . ?\\e$,2=L\e(B)
1403 (#x4a3 . ?\\e$,2=M\e(B)
1404 (#x4a4 . ?\e$,2=A\e(B)
1405 (#x4a5 . ?\e$,2?{\e(B)
1406 (#x4a6 . ?\e$,2?r\e(B)
1407 (#x4a7 . ?\e$,2?!\e(B)
1408 (#x4a8 . ?\e$,2?#\e(B)
1409 (#x4a9 . ?\e$,2?%\e(B)
1410 (#x4aa . ?\e$,2?'\e(B)
1411 (#x4ab . ?\e$,2?)\e(B)
1412 (#x4ac . ?\e$,2?c\e(B)
1413 (#x4ad . ?\e$,2?e\e(B)
1414 (#x4ae . ?\e$,2?g\e(B)
1415 (#x4af . ?\e$,2?C\e(B)
1416 (#x4b0 . ?\e$,2?|\e(B)
1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
1457 (#x4d9 . ?\e$,2?k\e(B)
1458 (#x4da . ?\e$,2?l\e(B)
1459 (#x4db . ?\e$,2?m\e(B)
1460 (#x4dc . ?\e$,2?o\e(B)
1461 (#x4dd . ?\e$,2?s\e(B)
1462 (#x4de . ?\e$,2>{\e(B)
1463 (#x4df . ?\e$,2>|\e(B)
1464 ;; Arabic
1465 (#x5ac . ?\e,G,\e(B)
1466 (#x5bb . ?\e,G;\e(B)
1467 (#x5bf . ?\e,G?\e(B)
1468 (#x5c1 . ?\e,GA\e(B)
1469 (#x5c2 . ?\e,GB\e(B)
1470 (#x5c3 . ?\e,GC\e(B)
1471 (#x5c4 . ?\e,GD\e(B)
1472 (#x5c5 . ?\e,GE\e(B)
1473 (#x5c6 . ?\e,GF\e(B)
1474 (#x5c7 . ?\e,GG\e(B)
1475 (#x5c8 . ?\e,GH\e(B)
1476 (#x5c9 . ?\e,GI\e(B)
1477 (#x5ca . ?\e,GJ\e(B)
1478 (#x5cb . ?\e,GK\e(B)
1479 (#x5cc . ?\e,GL\e(B)
1480 (#x5cd . ?\e,GM\e(B)
1481 (#x5ce . ?\e,GN\e(B)
1482 (#x5cf . ?\e,GO\e(B)
1483 (#x5d0 . ?\e,GP\e(B)
1484 (#x5d1 . ?\e,GQ\e(B)
1485 (#x5d2 . ?\e,GR\e(B)
1486 (#x5d3 . ?\e,GS\e(B)
1487 (#x5d4 . ?\e,GT\e(B)
1488 (#x5d5 . ?\e,GU\e(B)
1489 (#x5d6 . ?\e,GV\e(B)
1490 (#x5d7 . ?\e,GW\e(B)
1491 (#x5d8 . ?\e,GX\e(B)
1492 (#x5d9 . ?\e,GY\e(B)
1493 (#x5da . ?\e,GZ\e(B)
1494 (#x5e0 . ?\e,G`\e(B)
1495 (#x5e1 . ?\e,Ga\e(B)
1496 (#x5e2 . ?\e,Gb\e(B)
1497 (#x5e3 . ?\e,Gc\e(B)
1498 (#x5e4 . ?\e,Gd\e(B)
1499 (#x5e5 . ?\e,Ge\e(B)
1500 (#x5e6 . ?\e,Gf\e(B)
1501 (#x5e7 . ?\e,Gg\e(B)
1502 (#x5e8 . ?\e,Gh\e(B)
1503 (#x5e9 . ?\e,Gi\e(B)
1504 (#x5ea . ?\e,Gj\e(B)
1505 (#x5eb . ?\e,Gk\e(B)
1506 (#x5ec . ?\e,Gl\e(B)
1507 (#x5ed . ?\e,Gm\e(B)
1508 (#x5ee . ?\e,Gn\e(B)
1509 (#x5ef . ?\e,Go\e(B)
1510 (#x5f0 . ?\e,Gp\e(B)
1511 (#x5f1 . ?\e,Gq\e(B)
1512 (#x5f2 . ?\e,Gr\e(B)
1513 ;; Cyrillic
1cbe1e4b
KH
1514 (#x680 . ?\e$,1)R\e(B)
1515 (#x681 . ?\e$,1)V\e(B)
1516 (#x682 . ?\e$,1)Z\e(B)
1517 (#x683 . ?\e$,1)\\e(B)
1518 (#x684 . ?\e$,1)b\e(B)
1519 (#x685 . ?\e$,1)n\e(B)
1520 (#x686 . ?\e$,1)p\e(B)
1521 (#x687 . ?\e$,1)r\e(B)
1522 (#x688 . ?\e$,1)v\e(B)
1523 (#x689 . ?\e$,1)x\e(B)
1524 (#x68a . ?\e$,1)z\e(B)
1525 (#x68c . ?\e$,1*8\e(B)
1526 (#x68d . ?\e$,1*B\e(B)
1527 (#x68e . ?\e$,1*H\e(B)
1528 (#x68f . ?\e$,1*N\e(B)
1529 (#x690 . ?\e$,1)S\e(B)
1530 (#x691 . ?\e$,1)W\e(B)
1531 (#x692 . ?\e$,1)[\e(B)
1532 (#x693 . ?\e$,1)]\e(B)
1533 (#x694 . ?\e$,1)c\e(B)
1534 (#x695 . ?\e$,1)o\e(B)
1535 (#x696 . ?\e$,1)q\e(B)
1536 (#x697 . ?\e$,1)s\e(B)
1537 (#x698 . ?\e$,1)w\e(B)
1538 (#x699 . ?\e$,1)y\e(B)
1539 (#x69a . ?\e$,1){\e(B)
1540 (#x69c . ?\e$,1*9\e(B)
1541 (#x69d . ?\e$,1*C\e(B)
1542 (#x69e . ?\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1{ \e(B)
1714 (#x8a5 . ?\e$,1{!\e(B)
1715 (#x8a6 . ?\e$,2 "\e(B)
1716 (#x8a7 . ?\e$,1|A\e(B)
1717 (#x8a8 . ?\e$,1|C\e(B)
1718 (#x8a9 . ?\e$,1|D\e(B)
1719 (#x8aa . ?\e$,1|F\e(B)
1720 (#x8ab . ?\e$,1|;\e(B)
1721 (#x8ac . ?\e$,1|=\e(B)
1722 (#x8ad . ?\e$,1|>\e(B)
1723 (#x8ae . ?\e$,1|@\e(B)
1724 (#x8af . ?\e$,1|H\e(B)
1725 (#x8b0 . ?\e$,1|L\e(B)
1726 (#x8bc . ?\e$,1y$\e(B)
1727 (#x8bd . ?\e$,1y \e(B)
1728 (#x8be . ?\e$,1y%\e(B)
1729 (#x8bf . ?\e$,1xK\e(B)
1730 (#x8c0 . ?\e$,1xT\e(B)
1731 (#x8c1 . ?\e$,1x=\e(B)
1732 (#x8c2 . ?\e$,1x>\e(B)
1733 (#x8c5 . ?\e$,1x'\e(B)
1734 (#x8c8 . ?\e$,1x\\e(B)
1735 (#x8c9 . ?\e$,1xc\e(B)
1736 (#x8cd . ?\e$,1wT\e(B)
1737 (#x8ce . ?\e$,1wR\e(B)
1738 (#x8cf . ?\e$,1y!\e(B)
1739 (#x8d6 . ?\e$,1x:\e(B)
1740 (#x8da . ?\e$,1yB\e(B)
1741 (#x8db . ?\e$,1yC\e(B)
1742 (#x8dc . ?\e$,1xI\e(B)
1743 (#x8dd . ?\e$,1xJ\e(B)
1744 (#x8de . ?\e$,1xG\e(B)
1745 (#x8df . ?\e$,1xH\e(B)
1746 (#x8ef . ?\e$,1x"\e(B)
1747 (#x8f6 . ?\e$,1!R\e(B)
1748 (#x8fb . ?\e$,1vp\e(B)
1749 (#x8fc . ?\e$,1vq\e(B)
1750 (#x8fd . ?\e$,1vr\e(B)
1751 (#x8fe . ?\e$,1vs\e(B)
1752 ;; Special
1753 (#x9e0 . ?\e$,2"&\e(B)
1754 (#x9e1 . ?\e$,2!R\e(B)
1755 (#x9e2 . ?\e$,1}I\e(B)
1756 (#x9e3 . ?\e$,1}L\e(B)
1757 (#x9e4 . ?\e$,1}M\e(B)
1758 (#x9e5 . ?\e$,1}J\e(B)
1759 (#x9e8 . ?\e$,1}d\e(B)
1760 (#x9e9 . ?\e$,1}K\e(B)
1761 (#x9ea . ?\e$,2 8\e(B)
1762 (#x9eb . ?\e$,2 0\e(B)
1763 (#x9ec . ?\e$,2 ,\e(B)
1764 (#x9ed . ?\e$,2 4\e(B)
1765 (#x9ee . ?\e$,2 \\e(B)
1766 (#x9ef . ?\e$,1|Z\e(B)
1767 (#x9f0 . ?\e$,1|[\e(B)
1768 (#x9f1 . ?\e$,2 \e(B)
1769 (#x9f2 . ?\e$,1|\\e(B)
1770 (#x9f3 . ?\e$,1|]\e(B)
1771 (#x9f4 . ?\e$,2 <\e(B)
1772 (#x9f5 . ?\e$,2 D\e(B)
1773 (#x9f6 . ?\e$,2 T\e(B)
1774 (#x9f7 . ?\e$,2 L\e(B)
1775 (#x9f8 . ?\e$,2 "\e(B)
1776 ;; Publishing
1777 (#xaa1 . ?\e$,1rc\e(B)
1778 (#xaa2 . ?\e$,1rb\e(B)
1779 (#xaa3 . ?\e$,1rd\e(B)
1780 (#xaa4 . ?\e$,1re\e(B)
1781 (#xaa5 . ?\e$,1rg\e(B)
1782 (#xaa6 . ?\e$,1rh\e(B)
1783 (#xaa7 . ?\e$,1ri\e(B)
1784 (#xaa8 . ?\e$,1rj\e(B)
1785 (#xaa9 . ?\e$,1rt\e(B)
1786 (#xaaa . ?\e$,1rs\e(B)
1787 (#xaae . ?\e$,1s&\e(B)
1788 (#xaaf . ?\e$,1s%\e(B)
1789 (#xab0 . ?\e$,1v3\e(B)
1790 (#xab1 . ?\e$,1v4\e(B)
1791 (#xab2 . ?\e$,1v5\e(B)
1792 (#xab3 . ?\e$,1v6\e(B)
1793 (#xab4 . ?\e$,1v7\e(B)
1794 (#xab5 . ?\e$,1v8\e(B)
1795 (#xab6 . ?\e$,1v9\e(B)
1796 (#xab7 . ?\e$,1v:\e(B)
1797 (#xab8 . ?\e$,1uE\e(B)
1798 (#xabb . ?\e$,1rr\e(B)
1799 (#xabc . ?\e$,1{)\e(B)
1800 (#xabe . ?\e$,1{*\e(B)
1801 (#xac3 . ?\e$,1v;\e(B)
1802 (#xac4 . ?\e$,1v<\e(B)
1803 (#xac5 . ?\e$,1v=\e(B)
1804 (#xac6 . ?\e$,1v>\e(B)
1805 (#xac9 . ?\e$,1ub\e(B)
1806 (#xaca . ?\e$,2"s\e(B)
1807 (#xacc . ?\e$,2"!\e(B)
1808 (#xacd . ?\e$,2!w\e(B)
1809 (#xace . ?\e$,2"+\e(B)
1810 (#xacf . ?\e$,2!o\e(B)
1811 (#xad0 . ?\e$,1rx\e(B)
1812 (#xad1 . ?\e$,1ry\e(B)
1813 (#xad2 . ?\e$,1r|\e(B)
1814 (#xad3 . ?\e$,1r}\e(B)
1815 (#xad4 . ?\e$,1u^\e(B)
1816 (#xad6 . ?\e$,1s2\e(B)
1817 (#xad7 . ?\e$,1s3\e(B)
1818 (#xad9 . ?\e$,2%]\e(B)
1819 (#xadb . ?\e$,2!l\e(B)
1820 (#xadc . ?\e$,2" \e(B)
1821 (#xadd . ?\e$,2!v\e(B)
1822 (#xade . ?\e$,2"/\e(B)
1823 (#xadf . ?\e$,2!n\e(B)
1824 (#xae0 . ?\e$,2"F\e(B)
1825 (#xae1 . ?\e$,2!k\e(B)
1826 (#xae2 . ?\e$,2!m\e(B)
1827 (#xae3 . ?\e$,2!s\e(B)
1828 (#xae4 . ?\e$,2!}\e(B)
1829 (#xae5 . ?\e$,2"f\e(B)
1830 (#xae6 . ?\e$,1s"\e(B)
1831 (#xae7 . ?\e$,2!j\e(B)
1832 (#xae8 . ?\e$,2!r\e(B)
1833 (#xae9 . ?\e$,2!|\e(B)
1834 (#xaea . ?\e$,2"|\e(B)
1835 (#xaeb . ?\e$,2"~\e(B)
1836 (#xaec . ?\e$,2#c\e(B)
1837 (#xaed . ?\e$,2#f\e(B)
1838 (#xaee . ?\e$,2#e\e(B)
1839 (#xaf0 . ?\e$,2%`\e(B)
1840 (#xaf1 . ?\e$,1s \e(B)
1841 (#xaf2 . ?\e$,1s!\e(B)
1842 (#xaf3 . ?\e$,2%S\e(B)
1843 (#xaf4 . ?\e$,2%W\e(B)
1844 (#xaf5 . ?\e$,2#o\e(B)
1845 (#xaf6 . ?\e$,2#m\e(B)
1846 (#xaf7 . ?\e$,2#B\e(B)
1847 (#xaf8 . ?\e$,2#@\e(B)
1848 (#xaf9 . ?\e$,2"n\e(B)
1849 (#xafa . ?\e$,1zu\e(B)
1850 (#xafb . ?\e$,1uW\e(B)
1851 (#xafc . ?\e$,1s8\e(B)
1852 (#xafd . ?\e$,1rz\e(B)
1853 (#xafe . ?\e$,1r~\e(B)
1854 ;; APL
1855 (#xba3 . ?<)
1856 (#xba6 . ?>)
1857 (#xba8 . ?\e$,1xH\e(B)
1858 (#xba9 . ?\e$,1xG\e(B)
1859 (#xbc0 . ?\e,A/\e(B)
1860 (#xbc2 . ?\e$,1ye\e(B)
1861 (#xbc3 . ?\e$,1xI\e(B)
1862 (#xbc4 . ?\e$,1zj\e(B)
1863 (#xbc6 . ?_)
1864 (#xbca . ?\e$,1x8\e(B)
1865 (#xbcc . ?\e$,1|5\e(B)
1866 (#xbce . ?\e$,1yd\e(B)
1867 (#xbcf . ?\e$,2"+\e(B)
1868 (#xbd3 . ?\e$,1zh\e(B)
1869 (#xbd6 . ?\e$,1xJ\e(B)
1870 (#xbd8 . ?\e$,1yC\e(B)
1871 (#xbda . ?\e$,1yB\e(B)
1872 (#xbdc . ?\e$,1yb\e(B)
1873 (#xbfc . ?\e$,1yc\e(B)
1874 ;; Hebrew
1875 (#xcdf . ?\e,H_\e(B)
1876 (#xce0 . ?\e,H`\e(B)
1877 (#xce1 . ?\e,Ha\e(B)
1878 (#xce2 . ?\e,Hb\e(B)
1879 (#xce3 . ?\e,Hc\e(B)
1880 (#xce4 . ?\e,Hd\e(B)
1881 (#xce5 . ?\e,He\e(B)
1882 (#xce6 . ?\e,Hf\e(B)
1883 (#xce7 . ?\e,Hg\e(B)
1884 (#xce8 . ?\e,Hh\e(B)
1885 (#xce9 . ?\e,Hi\e(B)
1886 (#xcea . ?\e,Hj\e(B)
1887 (#xceb . ?\e,Hk\e(B)
1888 (#xcec . ?\e,Hl\e(B)
1889 (#xced . ?\e,Hm\e(B)
1890 (#xcee . ?\e,Hn\e(B)
1891 (#xcef . ?\e,Ho\e(B)
1892 (#xcf0 . ?\e,Hp\e(B)
1893 (#xcf1 . ?\e,Hq\e(B)
1894 (#xcf2 . ?\e,Hr\e(B)
1895 (#xcf3 . ?\e,Hs\e(B)
1896 (#xcf4 . ?\e,Ht\e(B)
1897 (#xcf5 . ?\e,Hu\e(B)
1898 (#xcf6 . ?\e,Hv\e(B)
1899 (#xcf7 . ?\e,Hw\e(B)
1900 (#xcf8 . ?\e,Hx\e(B)
1901 (#xcf9 . ?\e,Hy\e(B)
1902 (#xcfa . ?\e,Hz\e(B)
1903 ;; Thai
1904 (#xda1 . ?\e,T!\e(B)
1905 (#xda2 . ?\e,T"\e(B)
1906 (#xda3 . ?\e,T#\e(B)
1907 (#xda4 . ?\e,T$\e(B)
1908 (#xda5 . ?\e,T%\e(B)
1909 (#xda6 . ?\e,T&\e(B)
1910 (#xda7 . ?\e,T'\e(B)
1911 (#xda8 . ?\e,T(\e(B)
1912 (#xda9 . ?\e,T)\e(B)
1913 (#xdaa . ?\e,T*\e(B)
1914 (#xdab . ?\e,T+\e(B)
1915 (#xdac . ?\e,T,\e(B)
1916 (#xdad . ?\e,T-\e(B)
1917 (#xdae . ?\e,T.\e(B)
1918 (#xdaf . ?\e,T/\e(B)
1919 (#xdb0 . ?\e,T0\e(B)
1920 (#xdb1 . ?\e,T1\e(B)
1921 (#xdb2 . ?\e,T2\e(B)
1922 (#xdb3 . ?\e,T3\e(B)
1923 (#xdb4 . ?\e,T4\e(B)
1924 (#xdb5 . ?\e,T5\e(B)
1925 (#xdb6 . ?\e,T6\e(B)
1926 (#xdb7 . ?\e,T7\e(B)
1927 (#xdb8 . ?\e,T8\e(B)
1928 (#xdb9 . ?\e,T9\e(B)
1929 (#xdba . ?\e,T:\e(B)
1930 (#xdbb . ?\e,T;\e(B)
1931 (#xdbc . ?\e,T<\e(B)
1932 (#xdbd . ?\e,T=\e(B)
1933 (#xdbe . ?\e,T>\e(B)
1934 (#xdbf . ?\e,T?\e(B)
1935 (#xdc0 . ?\e,T@\e(B)
1936 (#xdc1 . ?\e,TA\e(B)
1937 (#xdc2 . ?\e,TB\e(B)
1938 (#xdc3 . ?\e,TC\e(B)
1939 (#xdc4 . ?\e,TD\e(B)
1940 (#xdc5 . ?\e,TE\e(B)
1941 (#xdc6 . ?\e,TF\e(B)
1942 (#xdc7 . ?\e,TG\e(B)
1943 (#xdc8 . ?\e,TH\e(B)
1944 (#xdc9 . ?\e,TI\e(B)
1945 (#xdca . ?\e,TJ\e(B)
1946 (#xdcb . ?\e,TK\e(B)
1947 (#xdcc . ?\e,TL\e(B)
1948 (#xdcd . ?\e,TM\e(B)
1949 (#xdce . ?\e,TN\e(B)
1950 (#xdcf . ?\e,TO\e(B)
1951 (#xdd0 . ?\e,TP\e(B)
1952 (#xdd1 . ?\e,TQ\e(B)
1953 (#xdd2 . ?\e,TR\e(B)
1954 (#xdd3 . ?\e,TS\e(B)
1955 (#xdd4 . ?\e,TT\e(B)
1956 (#xdd5 . ?\e,TU\e(B)
1957 (#xdd6 . ?\e,TV\e(B)
1958 (#xdd7 . ?\e,TW\e(B)
1959 (#xdd8 . ?\e,TX\e(B)
1960 (#xdd9 . ?\e,TY\e(B)
1961 (#xdda . ?\e,TZ\e(B)
1962 (#xddf . ?\e,T_\e(B)
1963 (#xde0 . ?\e,T`\e(B)
1964 (#xde1 . ?\e,Ta\e(B)
1965 (#xde2 . ?\e,Tb\e(B)
1966 (#xde3 . ?\e,Tc\e(B)
1967 (#xde4 . ?\e,Td\e(B)
1968 (#xde5 . ?\e,Te\e(B)
1969 (#xde6 . ?\e,Tf\e(B)
1970 (#xde7 . ?\e,Tg\e(B)
1971 (#xde8 . ?\e,Th\e(B)
1972 (#xde9 . ?\e,Ti\e(B)
1973 (#xdea . ?\e,Tj\e(B)
1974 (#xdeb . ?\e,Tk\e(B)
1975 (#xdec . ?\e,Tl\e(B)
1976 (#xded . ?\e,Tm\e(B)
1977 (#xdf0 . ?\e,Tp\e(B)
1978 (#xdf1 . ?\e,Tq\e(B)
1979 (#xdf2 . ?\e,Tr\e(B)
1980 (#xdf3 . ?\e,Ts\e(B)
1981 (#xdf4 . ?\e,Tt\e(B)
1982 (#xdf5 . ?\e,Tu\e(B)
1983 (#xdf6 . ?\e,Tv\e(B)
1984 (#xdf7 . ?\e,Tw\e(B)
1985 (#xdf8 . ?\e,Tx\e(B)
1986 (#xdf9 . ?\e,Ty\e(B)
1987 ;; Korean
1988 (#xea1 . ?\e$(C$!\e(B)
1989 (#xea2 . ?\e$(C$"\e(B)
1990 (#xea3 . ?\e$(C$#\e(B)
1991 (#xea4 . ?\e$(C$$\e(B)
1992 (#xea5 . ?\e$(C$%\e(B)
1993 (#xea6 . ?\e$(C$&\e(B)
1994 (#xea7 . ?\e$(C$'\e(B)
1995 (#xea8 . ?\e$(C$(\e(B)
1996 (#xea9 . ?\e$(C$)\e(B)
1997 (#xeaa . ?\e$(C$*\e(B)
1998 (#xeab . ?\e$(C$+\e(B)
1999 (#xeac . ?\e$(C$,\e(B)
2000 (#xead . ?\e$(C$-\e(B)
2001 (#xeae . ?\e$(C$.\e(B)
2002 (#xeaf . ?\e$(C$/\e(B)
2003 (#xeb0 . ?\e$(C$0\e(B)
2004 (#xeb1 . ?\e$(C$1\e(B)
2005 (#xeb2 . ?\e$(C$2\e(B)
2006 (#xeb3 . ?\e$(C$3\e(B)
2007 (#xeb4 . ?\e$(C$4\e(B)
2008 (#xeb5 . ?\e$(C$5\e(B)
2009 (#xeb6 . ?\e$(C$6\e(B)
2010 (#xeb7 . ?\e$(C$7\e(B)
2011 (#xeb8 . ?\e$(C$8\e(B)
2012 (#xeb9 . ?\e$(C$9\e(B)
2013 (#xeba . ?\e$(C$:\e(B)
2014 (#xebb . ?\e$(C$;\e(B)
2015 (#xebc . ?\e$(C$<\e(B)
2016 (#xebd . ?\e$(C$=\e(B)
2017 (#xebe . ?\e$(C$>\e(B)
2018 (#xebf . ?\e$(C$?\e(B)
2019 (#xec0 . ?\e$(C$@\e(B)
2020 (#xec1 . ?\e$(C$A\e(B)
2021 (#xec2 . ?\e$(C$B\e(B)
2022 (#xec3 . ?\e$(C$C\e(B)
2023 (#xec4 . ?\e$(C$D\e(B)
2024 (#xec5 . ?\e$(C$E\e(B)
2025 (#xec6 . ?\e$(C$F\e(B)
2026 (#xec7 . ?\e$(C$G\e(B)
2027 (#xec8 . ?\e$(C$H\e(B)
2028 (#xec9 . ?\e$(C$I\e(B)
2029 (#xeca . ?\e$(C$J\e(B)
2030 (#xecb . ?\e$(C$K\e(B)
2031 (#xecc . ?\e$(C$L\e(B)
2032 (#xecd . ?\e$(C$M\e(B)
2033 (#xece . ?\e$(C$N\e(B)
2034 (#xecf . ?\e$(C$O\e(B)
2035 (#xed0 . ?\e$(C$P\e(B)
2036 (#xed1 . ?\e$(C$Q\e(B)
2037 (#xed2 . ?\e$(C$R\e(B)
2038 (#xed3 . ?\e$(C$S\e(B)
2039 (#xed4 . ?\e$,1LH\e(B)
2040 (#xed5 . ?\e$,1LI\e(B)
2041 (#xed6 . ?\e$,1LJ\e(B)
2042 (#xed7 . ?\e$,1LK\e(B)
2043 (#xed8 . ?\e$,1LL\e(B)
2044 (#xed9 . ?\e$,1LM\e(B)
2045 (#xeda . ?\e$,1LN\e(B)
2046 (#xedb . ?\e$,1LO\e(B)
2047 (#xedc . ?\e$,1LP\e(B)
2048 (#xedd . ?\e$,1LQ\e(B)
2049 (#xede . ?\e$,1LR\e(B)
2050 (#xedf . ?\e$,1LS\e(B)
2051 (#xee0 . ?\e$,1LT\e(B)
2052 (#xee1 . ?\e$,1LU\e(B)
2053 (#xee2 . ?\e$,1LV\e(B)
2054 (#xee3 . ?\e$,1LW\e(B)
2055 (#xee4 . ?\e$,1LX\e(B)
2056 (#xee5 . ?\e$,1LY\e(B)
2057 (#xee6 . ?\e$,1LZ\e(B)
2058 (#xee7 . ?\e$,1L[\e(B)
2059 (#xee8 . ?\e$,1L\\e(B)
2060 (#xee9 . ?\e$,1L]\e(B)
2061 (#xeea . ?\e$,1L^\e(B)
2062 (#xeeb . ?\e$,1L_\e(B)
2063 (#xeec . ?\e$,1L`\e(B)
2064 (#xeed . ?\e$,1La\e(B)
2065 (#xeee . ?\e$,1Lb\e(B)
2066 (#xeef . ?\e$(C$]\e(B)
2067 (#xef0 . ?\e$(C$a\e(B)
2068 (#xef1 . ?\e$(C$h\e(B)
2069 (#xef2 . ?\e$(C$o\e(B)
2070 (#xef3 . ?\e$(C$q\e(B)
2071 (#xef4 . ?\e$(C$t\e(B)
2072 (#xef5 . ?\e$(C$v\e(B)
2073 (#xef6 . ?\e$(C$}\e(B)
2074 (#xef7 . ?\e$(C$~\e(B)
2075 (#xef8 . ?\e$,1M+\e(B)
2076 (#xef9 . ?\e$,1M0\e(B)
2077 (#xefa . ?\e$,1M9\e(B)
2078 (#xeff . ?\e$,1tI\e(B)
2079 ;; Latin-5
2080 ;; Latin-6
2081 ;; Latin-7
2082 ;; Latin-8
2083 ;; Latin-9
2084 (#x13bc . ?\e,b<\e(B)
2085 (#x13bd . ?\e,b=\e(B)
2086 (#x13be . ?\e,b>\e(B)
2087 ;; Currency
2088 (#x20a0 . ?\e$,1t@\e(B)
2089 (#x20a1 . ?\e$,1tA\e(B)
2090 (#x20a2 . ?\e$,1tB\e(B)
2091 (#x20a3 . ?\e$,1tC\e(B)
2092 (#x20a4 . ?\e$,1tD\e(B)
2093 (#x20a5 . ?\e$,1tE\e(B)
2094 (#x20a6 . ?\e$,1tF\e(B)
2095 (#x20a7 . ?\e$,1tG\e(B)
2096 (#x20a8 . ?\e$,1tH\e(B)
2097 (#x20aa . ?\e$,1tJ\e(B)
2098 (#x20ab . ?\e$,1tK\e(B)
2099 (#x20ac . ?\e,b$\e(B)))
2100 (puthash (car pair) (cdr pair) x-keysym-table))
2101
2102;; The following keysym codes for graphics are listed in the document
2103;; as not having unicodes available:
2104
2105;; #x08b1 TOP LEFT SUMMATION Technical
2106;; #x08b2 BOTTOM LEFT SUMMATION Technical
2107;; #x08b3 TOP VERTICAL SUMMATION CONNECTOR Technical
2108;; #x08b4 BOTTOM VERTICAL SUMMATION CONNECTOR Technical
2109;; #x08b5 TOP RIGHT SUMMATION Technical
2110;; #x08b6 BOTTOM RIGHT SUMMATION Technical
2111;; #x08b7 RIGHT MIDDLE SUMMATION Technical
2112;; #x0aac SIGNIFICANT BLANK SYMBOL Publish
2113;; #x0abd DECIMAL POINT Publish
2114;; #x0abf MARKER Publish
2115;; #x0acb TRADEMARK SIGN IN CIRCLE Publish
2116;; #x0ada HEXAGRAM Publish
2117;; #x0aff CURSOR Publish
2118;; #x0dde THAI MAIHANAKAT Thai
2119
2fb263f6
JB
2120\f
2121;;;; Selections and cut buffers
67c86cfc 2122
1c7c774b
SM
2123;; We keep track of the last text selected here, so we can check the
2124;; current selection against it, and avoid passing back our own text
2125;; from x-cut-buffer-or-selection-value. We track all three
2126;; seperately in case another X application only sets one of them
2127;; (say the cut buffer) we aren't fooled by the PRIMARY or
2128;; CLIPBOARD selection staying the same.
ae10d597
PJ
2129(defvar x-last-selected-text-clipboard nil
2130 "The value of the CLIPBOARD X selection last time we selected or
2131pasted text.")
089bc712 2132(defvar x-last-selected-text-primary nil
ae10d597
PJ
2133 "The value of the PRIMARY X selection last time we selected or
2134pasted text.")
089bc712 2135(defvar x-last-selected-text-cut nil
eb5ad242
KH
2136 "The value of the X cut buffer last time we selected or pasted text.
2137The actual text stored in the X cut buffer is what encoded from this value.")
2138(defvar x-last-selected-text-cut-encoded nil
2139 "The value of the X cut buffer last time we selected or pasted text.
2140This is the actual text stored in the X cut buffer.")
daa37602 2141
1c7c774b
SM
2142(defvar x-cut-buffer-max 20000 ; Note this value is overridden below.
2143 "Max number of characters to put in the cut buffer.
2144It is said that overlarge strings are slow to put into the cut buffer.")
2666a6a5 2145
d14518d8 2146(defcustom x-select-enable-clipboard nil
dc20df95 2147 "Non-nil means cutting and pasting uses the clipboard.
d14518d8
DL
2148This is in addition to, but in preference to, the primary selection."
2149 :type 'boolean
2150 :group 'killing)
dc20df95 2151
0e2f4e59 2152(defun x-select-text (text &optional push)
1c7c774b
SM
2153 "Make TEXT, a string, the primary X selection.
2154Also, set the value of X cut buffer 0, for backward compatibility
2155with older X applications.
2156gildea@stop.mail-abuse.org says it's not desirable to put kills
2157in the clipboard."
785080c5
RS
2158 ;; Don't send the cut buffer too much text.
2159 ;; It becomes slow, and if really big it causes errors.
ae10d597
PJ
2160 (cond ((>= (length text) x-cut-buffer-max)
2161 (x-set-cut-buffer "" push)
eb5ad242
KH
2162 (setq x-last-selected-text-cut ""
2163 x-last-selected-text-cut-encoded ""))
db95369b 2164 (t
eb5ad242
KH
2165 (setq x-last-selected-text-cut text
2166 x-last-selected-text-cut-encoded
2167 (encode-coding-string text (or locale-coding-system
2168 'iso-latin-1)))
2169 (x-set-cut-buffer x-last-selected-text-cut-encoded push)))
c8c72d6b 2170 (x-set-selection 'PRIMARY text)
ae10d597
PJ
2171 (setq x-last-selected-text-primary text)
2172 (when x-select-enable-clipboard
99b631c8
KH
2173 (x-set-selection 'CLIPBOARD text)
2174 (setq x-last-selected-text-clipboard text))
ae10d597 2175 )
492878e4 2176
c7d9df18
KH
2177(defvar x-select-request-type nil
2178 "*Data type request for X selection.
2179The value is nil, one of the following data types, or a list of them:
2180 `COMPOUND_TEXT', `UTF8_STRING', `STRING', `TEXT'
2181
2182If the value is nil, try `COMPOUND_TEXT' and `UTF8_STRING', and
2183use the more appropriate result. If both fail, try `STRING', and
2184then `TEXT'.
2185
2186If the value is one of the above symbols, try only the specified
2187type.
2188
2189If the value is a list of them, try each of them in the specified
2190order until succeed.")
2191
2192;; Helper function for x-selection-value. Select UTF8 or CTEXT
2193;; whichever is more appropriate. Here, we use this heurisitcs.
2194;;
2195;; (1) If their lengthes are different, select the longer one. This
2196;; is because an X client may just cut off unsupported characters.
2197;;
2198;; (2) Otherwise, if the Nth character of CTEXT is an ASCII
2199;; character that is different from the Nth character of UTF8,
2200;; select UTF8. This is because an X client may replace unsupported
2201;; characters with some ASCII character (typically ` ' or `?') in
2202;; CTEXT.
2203;;
2204;; (3) Otherwise, select CTEXT. This is because legacy charsets are
2205;; better for the current Emacs, especially when the selection owner
2206;; is also Emacs.
2207
2208(defun x-select-utf8-or-ctext (utf8 ctext)
2209 (let ((len-utf8 (length utf8))
2210 (len-ctext (length ctext))
2211 (selected ctext)
2212 (i 0)
2213 char)
2214 (if (/= len-utf8 len-ctext)
2215 (if (> len-utf8 len-ctext) utf8 ctext)
b040ac64
KH
2216 (let ((result (compare-strings utf8 0 len-utf8 ctext 0 len-ctext)))
2217 (if (or (eq result t)
2218 (>= (aref ctext (1- (abs result))) 128))
2219 ctext
2220 utf8)))))
c7d9df18 2221
d8338794
KH
2222;; Get a selection value of type TYPE by calling x-get-selection with
2223;; an appropiate DATA-TYPE argument decidd by `x-select-request-type'.
2224;; The return value is already decoded. If x-get-selection causes an
2225;; error, this function return nil.
2226
c7d9df18
KH
2227(defun x-selection-value (type)
2228 (let (text)
2229 (cond ((null x-select-request-type)
2230 (let (utf8 ctext utf8-coding)
2231 ;; We try both UTF8_STRING and COMPOUND_TEXT, and choose
2232 ;; the more appropriate one. If both fail, try STRING.
2233
2234 ;; At first try UTF8_STRING.
2235 (setq utf8 (condition-case nil
2236 (x-get-selection type 'UTF8_STRING)
2237 (error nil))
2238 utf8-coding last-coding-system-used)
2239 (if utf8
3ff05361 2240 ;; If it is a local selection, or it contains only
ef99df9a
KH
2241 ;; ASCII characers, choose it.
2242 (if (or (not (get-text-property 0 'foreign-selection utf8))
2243 (= (length utf8) (string-bytes utf8)))
c7d9df18
KH
2244 (setq text utf8)))
2245 ;; If not yet decided, try COMPOUND_TEXT.
2246 (if (not text)
2247 (if (setq ctext (condition-case nil
2248 (x-get-selection type 'COMPOUND_TEXT)
2249 (error nil)))
2250 ;; If UTF8_STRING was also successful, choose the
2251 ;; more appropriate one from UTF8 and CTEXT.
2252 (if utf8
2253 (setq text (x-select-utf8-or-ctext utf8 ctext))
2254 ;; Othewise, choose CTEXT.
c3ff5bc1
KH
2255 (setq text ctext))
2256 (setq text utf8)))
c7d9df18
KH
2257 ;; If not yet decided, try STRING.
2258 (or text
2259 (setq text (condition-case nil
2260 (x-get-selection type 'STRING)
2261 (error nil))))
2262 (if (eq text utf8)
2263 (setq last-coding-system-used utf8-coding))))
2264
2265 ((consp x-select-request-type)
2266 (let ((tail x-select-request-type))
2267 (while (and tail (not text))
2268 (condition-case nil
2269 (setq text (x-get-selection type (car tail)))
2270 (error nil))
2271 (setq tail (cdr tail)))))
2272
2273 (t
2274 (condition-case nil
2275 (setq text (x-get-selection type x-select-request-type))
2276 (error nil))))
2277
2278 (if text
2279 (remove-text-properties 0 (length text) '(foreign-selection nil) text))
2280 text))
5fd6d89f 2281
1c7c774b
SM
2282;; Return the value of the current X selection.
2283;; Consult the selection, and the cut buffer. Treat empty strings
2284;; as if they were unset.
2285;; If this function is called twice and finds the same text,
2286;; it returns nil the second time. This is so that a single
2287;; selection won't be added to the kill ring over and over.
492878e4 2288(defun x-cut-buffer-or-selection-value ()
ae10d597 2289 (let (clip-text primary-text cut-text)
8ba13581 2290 (when x-select-enable-clipboard
c7d9df18 2291 (setq clip-text (x-selection-value 'CLIPBOARD))
ae10d597
PJ
2292 (if (string= clip-text "") (setq clip-text nil))
2293
2294 ;; Check the CLIPBOARD selection for 'newness', is it different
2295 ;; from what we remebered them to be last time we did a
2296 ;; cut/paste operation.
db95369b 2297 (setq clip-text
ae10d597
PJ
2298 (cond;; check clipboard
2299 ((or (not clip-text) (string= clip-text ""))
2300 (setq x-last-selected-text-clipboard nil))
2301 ((eq clip-text x-last-selected-text-clipboard) nil)
2302 ((string= clip-text x-last-selected-text-clipboard)
db95369b 2303 ;; Record the newer string,
ae10d597
PJ
2304 ;; so subsequent calls can use the `eq' test.
2305 (setq x-last-selected-text-clipboard clip-text)
2306 nil)
2307 (t
2308 (setq x-last-selected-text-clipboard clip-text))))
2309 )
8ba13581 2310
c7d9df18 2311 (setq primary-text (x-selection-value 'PRIMARY))
ae10d597
PJ
2312 ;; Check the PRIMARY selection for 'newness', is it different
2313 ;; from what we remebered them to be last time we did a
2314 ;; cut/paste operation.
db95369b 2315 (setq primary-text
ae10d597
PJ
2316 (cond;; check primary selection
2317 ((or (not primary-text) (string= primary-text ""))
2318 (setq x-last-selected-text-primary nil))
2319 ((eq primary-text x-last-selected-text-primary) nil)
2320 ((string= primary-text x-last-selected-text-primary)
db95369b 2321 ;; Record the newer string,
ae10d597
PJ
2322 ;; so subsequent calls can use the `eq' test.
2323 (setq x-last-selected-text-primary primary-text)
2324 nil)
2325 (t
2326 (setq x-last-selected-text-primary primary-text))))
1be7f9b0 2327
ae10d597 2328 (setq cut-text (x-get-cut-buffer 0))
f6c7b4e7 2329
ae10d597
PJ
2330 ;; Check the x cut buffer for 'newness', is it different
2331 ;; from what we remebered them to be last time we did a
2332 ;; cut/paste operation.
db95369b 2333 (setq cut-text
eb5ad242 2334 (cond;; check cut buffer
ae10d597
PJ
2335 ((or (not cut-text) (string= cut-text ""))
2336 (setq x-last-selected-text-cut nil))
eb5ad242
KH
2337 ;; This short cut doesn't work because x-get-cut-buffer
2338 ;; always returns a newly created string.
2339 ;; ((eq cut-text x-last-selected-text-cut) nil)
2340 ((string= cut-text x-last-selected-text-cut-encoded)
2341 ;; See the comment above. No need of this recording.
db95369b 2342 ;; Record the newer string,
ae10d597 2343 ;; so subsequent calls can use the `eq' test.
eb5ad242
KH
2344 ;; (setq x-last-selected-text-cut cut-text)
2345 nil)
2346 (t
2347 (setq x-last-selected-text-cut-encoded cut-text
2348 x-last-selected-text-cut
2349 (decode-coding-string cut-text (or locale-coding-system
2350 'iso-latin-1))))))
ae10d597 2351
c7d9df18
KH
2352 ;; As we have done one selection, clear this now.
2353 (setq next-selection-coding-system nil)
2354
ae10d597
PJ
2355 ;; At this point we have recorded the current values for the
2356 ;; selection from clipboard (if we are supposed to) primary,
2357 ;; and cut buffer. So return the first one that has changed
2358 ;; (which is the first non-null one).
2359 ;;
2360 ;; NOTE: There will be cases where more than one of these has
2361 ;; changed and the new values differ. This indicates that
2362 ;; something like the following has happened since the last time
2363 ;; we looked at the selections: Application X set all the
2364 ;; selections, then Application Y set only one or two of them (say
2365 ;; just the cut-buffer). In this case since we don't have
2366 ;; timestamps there is no way to know what the 'correct' value to
2367 ;; return is. The nice thing to do would be to tell the user we
2368 ;; saw multiple possible selections and ask the user which was the
db95369b 2369 ;; one they wanted.
ae10d597
PJ
2370 ;; This code is still a big improvement because now the user can
2371 ;; futz with the current selection and get emacs to pay attention
2372 ;; to the cut buffer again (previously as soon as clipboard or
2373 ;; primary had been set the cut buffer would essentially never be
2374 ;; checked again).
2375 (or clip-text primary-text cut-text)
2376 ))
492878e4 2377
2fb263f6 2378\f
1c7c774b
SM
2379;; Do the actual X Windows setup here; the above code just defines
2380;; functions and variables that we use now.
2fb263f6
JB
2381
2382(setq command-line-args (x-handle-args command-line-args))
800642d2 2383
1c7c774b 2384;; Make sure we have a valid resource name.
800642d2
JB
2385(or (stringp x-resource-name)
2386 (let (i)
2387 (setq x-resource-name (invocation-name))
2388
2389 ;; Change any . or * characters in x-resource-name to hyphens,
2390 ;; so as not to choke when we use it in X resource queries.
2391 (while (setq i (string-match "[.*]" x-resource-name))
2392 (aset x-resource-name i ?-))))
2393
cf07d2bd
DL
2394(x-open-connection (or x-display-name
2395 (setq x-display-name (getenv "DISPLAY")))
2396 x-command-line-resources
2397 ;; Exit Emacs with fatal error if this fails.
2398 t)
2fb263f6 2399
ffe1dd7a 2400(setq frame-creation-function 'x-create-frame-with-faces)
3d80ef3f 2401
ef599142
RS
2402(setq x-cut-buffer-max (min (- (/ (x-server-max-request-size) 2) 100)
2403 x-cut-buffer-max))
2404
6acdd93e
KH
2405;; Setup the default fontset.
2406(setup-default-fontset)
2407
cf07d2bd
DL
2408;; Create the standard fontset.
2409(create-fontset-from-fontset-spec standard-fontset-spec t)
2410
2411;; Create fontset specified in X resources "Fontset-N" (N is 0, 1, ...).
2412(create-fontset-from-x-resource)
2413
2414;; Try to create a fontset from a font specification which comes
2415;; from initial-frame-alist, default-frame-alist, or X resource.
2416;; A font specification in command line argument (i.e. -fn XXXX)
2417;; should be already in default-frame-alist as a `font'
2418;; parameter. However, any font specifications in site-start
2419;; library, user's init file (.emacs), and default.el are not
2420;; yet handled here.
2421
2422(let ((font (or (cdr (assq 'font initial-frame-alist))
2423 (cdr (assq 'font default-frame-alist))
2424 (x-get-resource "font" "Font")))
2425 xlfd-fields resolved-name)
2426 (if (and font
2427 (not (query-fontset font))
2428 (setq resolved-name (x-resolve-font-name font))
2429 (setq xlfd-fields (x-decompose-font-name font)))
2430 (if (string= "fontset" (aref xlfd-fields xlfd-regexp-registry-subnum))
2431 (new-fontset font (x-complement-fontset-spec xlfd-fields nil))
2432 ;; Create a fontset from FONT. The fontset name is
2433 ;; generated from FONT.
2434 (create-fontset-from-ascii-font font resolved-name "startup"))))
f90080d4 2435
5d20eba6
JB
2436;; Apply a geometry resource to the initial frame. Put it at the end
2437;; of the alist, so that anything specified on the command line takes
2438;; precedence.
e42a4b86
RS
2439(let* ((res-geometry (x-get-resource "geometry" "Geometry"))
2440 parsed)
5d20eba6 2441 (if res-geometry
e42a4b86
RS
2442 (progn
2443 (setq parsed (x-parse-geometry res-geometry))
9b4234ae
RS
2444 ;; If the resource specifies a position,
2445 ;; call the position and size "user-specified".
2446 (if (or (assq 'top parsed) (assq 'left parsed))
2447 (setq parsed (cons '(user-position . t)
2448 (cons '(user-size . t) parsed))))
e42a4b86
RS
2449 ;; All geometry parms apply to the initial frame.
2450 (setq initial-frame-alist (append initial-frame-alist parsed))
2451 ;; The size parms apply to all frames.
2452 (if (assq 'height parsed)
2453 (setq default-frame-alist
2454 (cons (cons 'height (cdr (assq 'height parsed)))
2455 default-frame-alist)))
2456 (if (assq 'width parsed)
2457 (setq default-frame-alist
2458 (cons (cons 'width (cdr (assq 'width parsed)))
2459 default-frame-alist))))))
5d20eba6 2460
88046be2 2461;; Check the reverseVideo resource.
800642d2
JB
2462(let ((case-fold-search t))
2463 (let ((rv (x-get-resource "reverseVideo" "ReverseVideo")))
2464 (if (and rv
2465 (string-match "^\\(true\\|yes\\|on\\)$" rv))
2466 (setq default-frame-alist
2467 (cons '(reverse . t) default-frame-alist)))))
88046be2 2468
553624bf
RS
2469;; Set x-selection-timeout, measured in milliseconds.
2470(let ((res-selection-timeout
2471 (x-get-resource "selectionTimeout" "SelectionTimeout")))
5c2867e0 2472 (setq x-selection-timeout 20000)
553624bf
RS
2473 (if res-selection-timeout
2474 (setq x-selection-timeout (string-to-number res-selection-timeout))))
2475
3d80ef3f 2476(defun x-win-suspend-error ()
089bc712 2477 (error "Suspending an Emacs running under X makes no sense"))
c8c72d6b
JB
2478(add-hook 'suspend-hook 'x-win-suspend-error)
2479
1c7c774b 2480;; Arrange for the kill and yank functions to set and check the clipboard.
492878e4
JB
2481(setq interprogram-cut-function 'x-select-text)
2482(setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
63c86e17 2483
1c7c774b
SM
2484;; Turn off window-splitting optimization; X is usually fast enough
2485;; that this is only annoying.
0cc6db57 2486(setq split-window-keep-point t)
5cdb3f1e 2487
53631723 2488;; Don't show the frame name; that's redundant with X.
982fa4e5 2489(setq-default mode-line-frame-identification " ")
53631723 2490
c3ef5084
SM
2491;; Motif direct handling of f10 wasn't working right,
2492;; So temporarily we've turned it off in lwlib-Xm.c
2493;; and turned the Emacs f10 back on.
2494;; ;; Motif normally handles f10 itself, so don't try to handle it a second time.
2495;; (if (featurep 'motif)
2496;; (global-set-key [f10] 'ignore))
2497
2498;; Turn on support for mouse wheels.
2499(mouse-wheel-mode 1)
9541a441 2500
133aad74 2501
a5bfbd4e
JD
2502;; Enable CLIPBOARD copy/paste through menu bar commands.
2503(menu-bar-enable-clipboard)
2504
2505;; Override Paste so it looks at CLIPBOARD first.
2506(defun x-clipboard-yank ()
2507 "Insert the clipboard contents, or the last stretch of killed text."
c0acb3ee 2508 (interactive "*")
d8338794 2509 (let ((clipboard-text (x-selection-value 'CLIPBOARD))
a5bfbd4e
JD
2510 (x-select-enable-clipboard t))
2511 (if (and clipboard-text (> (length clipboard-text) 0))
2512 (kill-new clipboard-text))
2513 (yank)))
2514
2515(define-key menu-bar-edit-menu [paste]
36942205
JD
2516 '(menu-item "Paste" x-clipboard-yank
2517 :enable (not buffer-read-only)
2518 :help "Paste (yank) text most recently cut/copied"))
a5bfbd4e 2519
133aad74
JD
2520;; Initiate drag and drop
2521(add-hook 'after-make-frame-functions 'x-dnd-init-frame)
c0acb3ee 2522(define-key special-event-map [drag-n-drop] 'x-dnd-handle-drag-n-drop-event)
133aad74 2523
e380957e 2524;; Let F10 do menu bar navigation.
0fba87a8
JD
2525(defun x-menu-bar-open (&optional frame)
2526 "Open the menu bar if `menu-bar-mode' is on. otherwise call `tmm-menubar'."
2527 (interactive "i")
2528 (if menu-bar-mode (menu-bar-open frame)
2529 (tmm-menubar)))
2530
4054794d 2531(and (fboundp 'menu-bar-open)
0fba87a8 2532 (global-set-key [f10] 'x-menu-bar-open))
e380957e 2533
1c7c774b 2534;; arch-tag: f1501302-db8b-4d95-88e3-116697d89f78
5cdb3f1e 2535;;; x-win.el ends here