Change clipboard/primary selection to X application standards.
[bpt/emacs.git] / lisp / term / x-win.el
1 ;;; x-win.el --- parse relevant switches and set up for X -*-coding: iso-2022-7bit;-*-
2
3 ;; Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
4 ;; 2008, 2009, 2010 Free Software Foundation, Inc.
5
6 ;; Author: FSF
7 ;; Keywords: terminals, i18n
8
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 3 of the License, or
14 ;; (at your option) 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. If not, see <http://www.gnu.org/licenses/>.
23
24 ;;; Commentary:
25
26 ;; X-win.el: this file defines functions to initialize the X window
27 ;; system and process X-specific command line parameters before
28 ;; creating the first X frame.
29
30 ;; Beginning in Emacs 23, the act of loading this file should not have
31 ;; the side effect of initializing the window system or processing
32 ;; command line arguments (this file is now loaded in loadup.el). See
33 ;; the variables `handle-args-function-alist' and
34 ;; `window-system-initialization-alist' for more details.
35
36 ;; startup.el will then examine startup files, and eventually call the hooks
37 ;; which create the first window(s).
38
39 ;;; Code:
40 \f
41 ;; These are the standard X switches from the Xt Initialize.c file of
42 ;; Release 4.
43
44 ;; Command line Resource Manager string
45
46 ;; +rv *reverseVideo
47 ;; +synchronous *synchronous
48 ;; -background *background
49 ;; -bd *borderColor
50 ;; -bg *background
51 ;; -bordercolor *borderColor
52 ;; -borderwidth .borderWidth
53 ;; -bw .borderWidth
54 ;; -display .display
55 ;; -fg *foreground
56 ;; -fn *font
57 ;; -font *font
58 ;; -foreground *foreground
59 ;; -geometry .geometry
60 ;; -iconic .iconic
61 ;; -name .name
62 ;; -reverse *reverseVideo
63 ;; -rv *reverseVideo
64 ;; -selectionTimeout .selectionTimeout
65 ;; -synchronous *synchronous
66 ;; -xrm
67
68 ;; An alist of X options and the function which handles them. See
69 ;; ../startup.el.
70
71 (if (not (fboundp 'x-create-frame))
72 (error "%s: Loading x-win.el but not compiled for X" (invocation-name)))
73
74 (require 'frame)
75 (require 'mouse)
76 (require 'scroll-bar)
77 (require 'faces)
78 (require 'select)
79 (require 'menu-bar)
80 (require 'fontset)
81 (require 'x-dnd)
82
83 (defvar x-invocation-args)
84 (defvar x-keysym-table)
85 (defvar x-selection-timeout)
86 (defvar x-session-id)
87 (defvar x-session-previous-id)
88
89 (defun x-handle-no-bitmap-icon (switch)
90 (setq default-frame-alist (cons '(icon-type) default-frame-alist)))
91
92 ;; Handle the --parent-id option.
93 (defun x-handle-parent-id (switch)
94 (or (consp x-invocation-args)
95 (error "%s: missing argument to `%s' option" (invocation-name) switch))
96 (setq initial-frame-alist (cons
97 (cons 'parent-id
98 (string-to-number (car x-invocation-args)))
99 initial-frame-alist)
100 x-invocation-args (cdr x-invocation-args)))
101
102 ;; Handle the --smid switch. This is used by the session manager
103 ;; to give us back our session id we had on the previous run.
104 (defun x-handle-smid (switch)
105 (or (consp x-invocation-args)
106 (error "%s: missing argument to `%s' option" (invocation-name) switch))
107 (setq x-session-previous-id (car x-invocation-args)
108 x-invocation-args (cdr x-invocation-args)))
109
110 (defvar emacs-save-session-functions nil
111 "Special hook run when a save-session event occurs.
112 The functions do not get any argument.
113 Functions can return non-nil to inform the session manager that the
114 window system shutdown should be aborted.
115
116 See also `emacs-session-save'.")
117
118 (defun emacs-session-filename (session-id)
119 "Construct a filename to save the session in based on SESSION-ID.
120 If the directory ~/.emacs.d exists, we make a filename in there, otherwise
121 a file in the home directory."
122 (let ((basename (concat "session." session-id))
123 (emacs-dir user-emacs-directory))
124 (expand-file-name (if (file-directory-p emacs-dir)
125 (concat emacs-dir basename)
126 (concat "~/.emacs-" basename)))))
127
128 (defun emacs-session-save ()
129 "This function is called when the window system is shutting down.
130 If this function returns non-nil, the window system shutdown is cancelled.
131
132 When a session manager tells Emacs that the window system is shutting
133 down, this function is called. It calls the functions in the hook
134 `emacs-save-session-functions'. Functions are called with the current
135 buffer set to a temporary buffer. Functions should use `insert' to insert
136 lisp code to save the session state. The buffer is saved in a file in the
137 home directory of the user running Emacs. The file is evaluated when
138 Emacs is restarted by the session manager.
139
140 If any of the functions returns non-nil, no more functions are called
141 and this function returns non-nil. This will inform the session manager
142 that it should abort the window system shutdown."
143 (let ((filename (emacs-session-filename x-session-id))
144 (buf (get-buffer-create (concat " *SES " x-session-id))))
145 (when (file-exists-p filename)
146 (delete-file filename))
147 (with-current-buffer buf
148 (let ((cancel-shutdown (condition-case nil
149 ;; A return of t means cancel the shutdown.
150 (run-hook-with-args-until-success
151 'emacs-save-session-functions)
152 (error t))))
153 (unless cancel-shutdown
154 (write-file filename))
155 (kill-buffer buf)
156 cancel-shutdown))))
157
158 (defun emacs-session-restore (previous-session-id)
159 "Restore the Emacs session if started by a session manager.
160 The file saved by `emacs-session-save' is evaluated and deleted if it
161 exists."
162 (let ((filename (emacs-session-filename previous-session-id)))
163 (when (file-exists-p filename)
164 (load-file filename)
165 (delete-file filename)
166 (message "Restored session data"))))
167
168
169
170 \f
171 ;;
172 ;; Standard X cursor shapes, courtesy of Mr. Fox, who wanted ALL of them.
173 ;;
174
175 (defconst x-pointer-X-cursor 0)
176 (defconst x-pointer-arrow 2)
177 (defconst x-pointer-based-arrow-down 4)
178 (defconst x-pointer-based-arrow-up 6)
179 (defconst x-pointer-boat 8)
180 (defconst x-pointer-bogosity 10)
181 (defconst x-pointer-bottom-left-corner 12)
182 (defconst x-pointer-bottom-right-corner 14)
183 (defconst x-pointer-bottom-side 16)
184 (defconst x-pointer-bottom-tee 18)
185 (defconst x-pointer-box-spiral 20)
186 (defconst x-pointer-center-ptr 22)
187 (defconst x-pointer-circle 24)
188 (defconst x-pointer-clock 26)
189 (defconst x-pointer-coffee-mug 28)
190 (defconst x-pointer-cross 30)
191 (defconst x-pointer-cross-reverse 32)
192 (defconst x-pointer-crosshair 34)
193 (defconst x-pointer-diamond-cross 36)
194 (defconst x-pointer-dot 38)
195 (defconst x-pointer-dotbox 40)
196 (defconst x-pointer-double-arrow 42)
197 (defconst x-pointer-draft-large 44)
198 (defconst x-pointer-draft-small 46)
199 (defconst x-pointer-draped-box 48)
200 (defconst x-pointer-exchange 50)
201 (defconst x-pointer-fleur 52)
202 (defconst x-pointer-gobbler 54)
203 (defconst x-pointer-gumby 56)
204 (defconst x-pointer-hand1 58)
205 (defconst x-pointer-hand2 60)
206 (defconst x-pointer-heart 62)
207 (defconst x-pointer-icon 64)
208 (defconst x-pointer-iron-cross 66)
209 (defconst x-pointer-left-ptr 68)
210 (defconst x-pointer-left-side 70)
211 (defconst x-pointer-left-tee 72)
212 (defconst x-pointer-leftbutton 74)
213 (defconst x-pointer-ll-angle 76)
214 (defconst x-pointer-lr-angle 78)
215 (defconst x-pointer-man 80)
216 (defconst x-pointer-middlebutton 82)
217 (defconst x-pointer-mouse 84)
218 (defconst x-pointer-pencil 86)
219 (defconst x-pointer-pirate 88)
220 (defconst x-pointer-plus 90)
221 (defconst x-pointer-question-arrow 92)
222 (defconst x-pointer-right-ptr 94)
223 (defconst x-pointer-right-side 96)
224 (defconst x-pointer-right-tee 98)
225 (defconst x-pointer-rightbutton 100)
226 (defconst x-pointer-rtl-logo 102)
227 (defconst x-pointer-sailboat 104)
228 (defconst x-pointer-sb-down-arrow 106)
229 (defconst x-pointer-sb-h-double-arrow 108)
230 (defconst x-pointer-sb-left-arrow 110)
231 (defconst x-pointer-sb-right-arrow 112)
232 (defconst x-pointer-sb-up-arrow 114)
233 (defconst x-pointer-sb-v-double-arrow 116)
234 (defconst x-pointer-shuttle 118)
235 (defconst x-pointer-sizing 120)
236 (defconst x-pointer-spider 122)
237 (defconst x-pointer-spraycan 124)
238 (defconst x-pointer-star 126)
239 (defconst x-pointer-target 128)
240 (defconst x-pointer-tcross 130)
241 (defconst x-pointer-top-left-arrow 132)
242 (defconst x-pointer-top-left-corner 134)
243 (defconst x-pointer-top-right-corner 136)
244 (defconst x-pointer-top-side 138)
245 (defconst x-pointer-top-tee 140)
246 (defconst x-pointer-trek 142)
247 (defconst x-pointer-ul-angle 144)
248 (defconst x-pointer-umbrella 146)
249 (defconst x-pointer-ur-angle 148)
250 (defconst x-pointer-watch 150)
251 (defconst x-pointer-xterm 152)
252 (defconst x-pointer-invisible 255)
253
254 \f
255 (defvar x-colors)
256
257 (defun xw-defined-colors (&optional frame)
258 "Internal function called by `defined-colors'."
259 (or frame (setq frame (selected-frame)))
260 (let ((all-colors x-colors)
261 (this-color nil)
262 (defined-colors nil))
263 (while all-colors
264 (setq this-color (car all-colors)
265 all-colors (cdr all-colors))
266 (and (color-supported-p this-color frame t)
267 (setq defined-colors (cons this-color defined-colors))))
268 defined-colors))
269 \f
270 ;;;; Function keys
271
272 (defvar x-alternatives-map
273 (let ((map (make-sparse-keymap)))
274 ;; Map certain keypad keys into ASCII characters that people usually expect.
275 (define-key map [M-backspace] [?\M-\d])
276 (define-key map [M-delete] [?\M-\d])
277 (define-key map [M-tab] [?\M-\t])
278 (define-key map [M-linefeed] [?\M-\n])
279 (define-key map [M-clear] [?\M-\C-l])
280 (define-key map [M-return] [?\M-\C-m])
281 (define-key map [M-escape] [?\M-\e])
282 (define-key map [iso-lefttab] [backtab])
283 (define-key map [S-iso-lefttab] [backtab])
284 map)
285 "Keymap of possible alternative meanings for some keys.")
286
287 (defun x-setup-function-keys (frame)
288 "Set up `function-key-map' on the graphical frame FRAME."
289 ;; Don't do this twice on the same display, or it would break
290 ;; normal-erase-is-backspace-mode.
291 (unless (terminal-parameter frame 'x-setup-function-keys)
292 ;; Map certain keypad keys into ASCII characters that people usually expect.
293 (with-selected-frame frame
294 (let ((map (copy-keymap x-alternatives-map)))
295 (set-keymap-parent map (keymap-parent local-function-key-map))
296 (set-keymap-parent local-function-key-map map)))
297 (set-terminal-parameter frame 'x-setup-function-keys t)))
298 \f
299 ;;;; Keysyms
300
301 (defun vendor-specific-keysyms (vendor)
302 "Return the appropriate value of `system-key-alist' for VENDOR.
303 VENDOR is a string containing the name of the X Server's vendor,
304 as returned by `x-server-vendor'."
305 (cond ((or (string-equal vendor "Hewlett-Packard Incorporated")
306 (string-equal vendor "Hewlett-Packard Company"))
307 '(( 168 . mute-acute)
308 ( 169 . mute-grave)
309 ( 170 . mute-asciicircum)
310 ( 171 . mute-diaeresis)
311 ( 172 . mute-asciitilde)
312 ( 175 . lira)
313 ( 190 . guilder)
314 ( 252 . block)
315 ( 256 . longminus)
316 (65388 . reset)
317 (65389 . system)
318 (65390 . user)
319 (65391 . clearline)
320 (65392 . insertline)
321 (65393 . deleteline)
322 (65394 . insertchar)
323 (65395 . deletechar)
324 (65396 . backtab)
325 (65397 . kp-backtab)))
326 ;; Fixme: What about non-X11/NeWS sun server?
327 ((or (string-equal vendor "X11/NeWS - Sun Microsystems Inc.")
328 (string-equal vendor "X Consortium"))
329 '((392976 . f36)
330 (392977 . f37)
331 (393056 . req)
332 ;; These are for Sun under X11R6
333 (393072 . props)
334 (393073 . front)
335 (393074 . copy)
336 (393075 . open)
337 (393076 . paste)
338 (393077 . cut)))
339 (t
340 ;; This is used by DEC's X server.
341 '((65280 . remove)))))
342
343 ;; Latin-1
344 (let ((i 160))
345 (while (< i 256)
346 (puthash i i x-keysym-table)
347 (setq i (1+ i))))
348
349 ;; Table from Kuhn's proposed additions to the `KEYSYM Encoding'
350 ;; appendix to the X protocol definition.
351 (dolist
352 (pair
353 '(
354 ;; Latin-2
355 (#x1a1 . ?\e,B!\e(B)
356 (#x1a2 . ?\e,B"\e(B)
357 (#x1a3 . ?\e,B#\e(B)
358 (#x1a5 . ?\e,B%\e(B)
359 (#x1a6 . ?\e,B&\e(B)
360 (#x1a9 . ?\e,B)\e(B)
361 (#x1aa . ?\e,B*\e(B)
362 (#x1ab . ?\e,B+\e(B)
363 (#x1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x1f9 . ?\e,By\e(B)
409 (#x1fb . ?\e,B{\e(B)
410 (#x1fe . ?\e,B~\e(B)
411 (#x1ff . ?\e,B\7f\e(B)
412 ;; Latin-3
413 (#x2a1 . ?\e,C!\e(B)
414 (#x2a6 . ?\e,C&\e(B)
415 (#x2a9 . ?\e,C)\e(B)
416 (#x2ab . ?\e,C+\e(B)
417 (#x2ac . ?\e,C,\e(B)
418 (#x2b1 . ?\e,C1\e(B)
419 (#x2b6 . ?\e,C6\e(B)
420 (#x2b9 . ?\e,C9\e(B)
421 (#x2bb . ?\e,C;\e(B)
422 (#x2bc . ?\e,C<\e(B)
423 (#x2c5 . ?\e,CE\e(B)
424 (#x2c6 . ?\e,CF\e(B)
425 (#x2d5 . ?\e,CU\e(B)
426 (#x2d8 . ?\e,CX\e(B)
427 (#x2dd . ?\e,C]\e(B)
428 (#x2de . ?\e,C^\e(B)
429 (#x2e5 . ?\e,Ce\e(B)
430 (#x2e6 . ?\e,Cf\e(B)
431 (#x2f5 . ?\e,Cu\e(B)
432 (#x2f8 . ?\e,Cx\e(B)
433 (#x2fd . ?\e,C}\e(B)
434 (#x2fe . ?\e,C~\e(B)
435 ;; Latin-4
436 (#x3a2 . ?\e,D"\e(B)
437 (#x3a3 . ?\e,D#\e(B)
438 (#x3a5 . ?\e,D%\e(B)
439 (#x3a6 . ?\e,D&\e(B)
440 (#x3aa . ?\e,D*\e(B)
441 (#x3ab . ?\e,D+\e(B)
442 (#x3ac . ?\e,D,\e(B)
443 (#x3b3 . ?\e,D3\e(B)
444 (#x3b5 . ?\e,D5\e(B)
445 (#x3b6 . ?\e,D6\e(B)
446 (#x3ba . ?\e,D:\e(B)
447 (#x3bb . ?\e,D;\e(B)
448 (#x3bc . ?\e,D<\e(B)
449 (#x3bd . ?\e,D=\e(B)
450 (#x3bf . ?\e,D?\e(B)
451 (#x3c0 . ?\e,D@\e(B)
452 (#x3c7 . ?\e,DG\e(B)
453 (#x3cc . ?\e,DL\e(B)
454 (#x3cf . ?\e,DO\e(B)
455 (#x3d1 . ?\e,DQ\e(B)
456 (#x3d2 . ?\e,DR\e(B)
457 (#x3d3 . ?\e,DS\e(B)
458 (#x3d9 . ?\e,DY\e(B)
459 (#x3dd . ?\e,D]\e(B)
460 (#x3de . ?\e,D^\e(B)
461 (#x3e0 . ?\e,D`\e(B)
462 (#x3e7 . ?\e,Dg\e(B)
463 (#x3ec . ?\e,Dl\e(B)
464 (#x3ef . ?\e,Do\e(B)
465 (#x3f1 . ?\e,Dq\e(B)
466 (#x3f2 . ?\e,Dr\e(B)
467 (#x3f3 . ?\e,Ds\e(B)
468 (#x3f9 . ?\e,Dy\e(B)
469 (#x3fd . ?\e,D}\e(B)
470 (#x3fe . ?\e,D~\e(B)
471 ;; Kana: Fixme: needs conversion to Japanese charset -- seems
472 ;; to require jisx0213, for which the Unicode translation
473 ;; isn't clear.
474 (#x47e . ?\e(J~\e(B)
475 (#x4a1 . ?\e$A!#\e(B)
476 (#x4a2 . ?\\e$A!8\e(B)
477 (#x4a3 . ?\\e$A!9\e(B)
478 (#x4a4 . ?\e$A!"\e(B)
479 (#x4a5 . ?\e$A!$\e(B)
480 (#x4a6 . ?\e$A%r\e(B)
481 (#x4a7 . ?\e$A%!\e(B)
482 (#x4a8 . ?\e$A%#\e(B)
483 (#x4a9 . ?\e$A%%\e(B)
484 (#x4aa . ?\e$A%'\e(B)
485 (#x4ab . ?\e$A%)\e(B)
486 (#x4ac . ?\e$A%c\e(B)
487 (#x4ad . ?\e$A%e\e(B)
488 (#x4ae . ?\e$A%g\e(B)
489 (#x4af . ?\e$A%C\e(B)
490 (#x4b0 . ?\e$B!<\e(B)
491 (#x4b1 . ?\e$A%"\e(B)
492 (#x4b2 . ?\e$A%$\e(B)
493 (#x4b3 . ?\e$A%&\e(B)
494 (#x4b4 . ?\e$A%(\e(B)
495 (#x4b5 . ?\e$A%*\e(B)
496 (#x4b6 . ?\e$A%+\e(B)
497 (#x4b7 . ?\e$A%-\e(B)
498 (#x4b8 . ?\e$A%/\e(B)
499 (#x4b9 . ?\e$A%1\e(B)
500 (#x4ba . ?\e$A%3\e(B)
501 (#x4bb . ?\e$A%5\e(B)
502 (#x4bc . ?\e$A%7\e(B)
503 (#x4bd . ?\e$A%9\e(B)
504 (#x4be . ?\e$A%;\e(B)
505 (#x4bf . ?\e$A%=\e(B)
506 (#x4c0 . ?\e$A%?\e(B)
507 (#x4c1 . ?\e$A%A\e(B)
508 (#x4c2 . ?\e$A%D\e(B)
509 (#x4c3 . ?\e$A%F\e(B)
510 (#x4c4 . ?\e$A%H\e(B)
511 (#x4c5 . ?\e$A%J\e(B)
512 (#x4c6 . ?\e$A%K\e(B)
513 (#x4c7 . ?\e$A%L\e(B)
514 (#x4c8 . ?\e$A%M\e(B)
515 (#x4c9 . ?\e$A%N\e(B)
516 (#x4ca . ?\e$A%O\e(B)
517 (#x4cb . ?\e$A%R\e(B)
518 (#x4cc . ?\e$A%U\e(B)
519 (#x4cd . ?\e$A%X\e(B)
520 (#x4ce . ?\e$A%[\e(B)
521 (#x4cf . ?\e$A%^\e(B)
522 (#x4d0 . ?\e$A%_\e(B)
523 (#x4d1 . ?\e$A%`\e(B)
524 (#x4d2 . ?\e$A%a\e(B)
525 (#x4d3 . ?\e$A%b\e(B)
526 (#x4d4 . ?\e$A%d\e(B)
527 (#x4d5 . ?\e$A%f\e(B)
528 (#x4d6 . ?\e$A%h\e(B)
529 (#x4d7 . ?\e$A%i\e(B)
530 (#x4d8 . ?\e$A%j\e(B)
531 (#x4d9 . ?\e$A%k\e(B)
532 (#x4da . ?\e$A%l\e(B)
533 (#x4db . ?\e$A%m\e(B)
534 (#x4dc . ?\e$A%o\e(B)
535 (#x4dd . ?\e$A%s\e(B)
536 (#x4de . ?\e$B!+\e(B)
537 (#x4df . ?\e$B!,\e(B)
538 ;; Arabic
539 (#x5ac . ?\e,G,\e(B)
540 (#x5bb . ?\e,G;\e(B)
541 (#x5bf . ?\e,G?\e(B)
542 (#x5c1 . ?\e,GA\e(B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; Cyrillic
588 (#x680 . ?\e$,1)R\e(B)
589 (#x681 . ?\e$,1)V\e(B)
590 (#x682 . ?\e$,1)Z\e(B)
591 (#x683 . ?\e$,1)\\e(B)
592 (#x684 . ?\e$,1)b\e(B)
593 (#x685 . ?\e$,1)n\e(B)
594 (#x686 . ?\e$,1)p\e(B)
595 (#x687 . ?\e$,1)r\e(B)
596 (#x688 . ?\e$,1)v\e(B)
597 (#x689 . ?\e$,1)x\e(B)
598 (#x68a . ?\e$,1)z\e(B)
599 (#x68c . ?\e$,1*8\e(B)
600 (#x68d . ?\e$,1*B\e(B)
601 (#x68e . ?\e$,1*H\e(B)
602 (#x68f . ?\e$,1*N\e(B)
603 (#x690 . ?\e$,1)S\e(B)
604 (#x691 . ?\e$,1)W\e(B)
605 (#x692 . ?\e$,1)[\e(B)
606 (#x693 . ?\e$,1)]\e(B)
607 (#x694 . ?\e$,1)c\e(B)
608 (#x695 . ?\e$,1)o\e(B)
609 (#x696 . ?\e$,1)q\e(B)
610 (#x697 . ?\e$,1)s\e(B)
611 (#x698 . ?\e$,1)w\e(B)
612 (#x699 . ?\e$,1)y\e(B)
613 (#x69a . ?\e$,1){\e(B)
614 (#x69c . ?\e$,1*9\e(B)
615 (#x69d . ?\e$,1*C\e(B)
616 (#x69e . ?\e$,1*I\e(B)
617 (#x69f . ?\e$,1*O\e(B)
618 (#x6a1 . ?\e,Lr\e(B)
619 (#x6a2 . ?\e,Ls\e(B)
620 (#x6a3 . ?\e,Lq\e(B)
621 (#x6a4 . ?\e,Lt\e(B)
622 (#x6a5 . ?\e,Lu\e(B)
623 (#x6a6 . ?\e,Lv\e(B)
624 (#x6a7 . ?\e,Lw\e(B)
625 (#x6a8 . ?\e,Lx\e(B)
626 (#x6a9 . ?\e,Ly\e(B)
627 (#x6aa . ?\e,Lz\e(B)
628 (#x6ab . ?\e,L{\e(B)
629 (#x6ac . ?\e,L|\e(B)
630 (#x6ae . ?\e,L~\e(B)
631 (#x6af . ?\e,L\7f\e(B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li\e(B)
677 (#x6de . ?\e,Lg\e(B)
678 (#x6df . ?\e,Lj\e(B)
679 (#x6e0 . ?\e,LN\e(B)
680 (#x6e1 . ?\e,L0\e(B)
681 (#x6e2 . ?\e,L1\e(B)
682 (#x6e3 . ?\e,LF\e(B)
683 (#x6e4 . ?\e,L4\e(B)
684 (#x6e5 . ?\e,L5\e(B)
685 (#x6e6 . ?\e,LD\e(B)
686 (#x6e7 . ?\e,L3\e(B)
687 (#x6e8 . ?\e,LE\e(B)
688 (#x6e9 . ?\e,L8\e(B)
689 (#x6ea . ?\e,L9\e(B)
690 (#x6eb . ?\e,L:\e(B)
691 (#x6ec . ?\e,L;\e(B)
692 (#x6ed . ?\e,L<\e(B)
693 (#x6ee . ?\e,L=\e(B)
694 (#x6ef . ?\e,L>\e(B)
695 (#x6f0 . ?\e,L?\e(B)
696 (#x6f1 . ?\e,LO\e(B)
697 (#x6f2 . ?\e,L@\e(B)
698 (#x6f3 . ?\e,LA\e(B)
699 (#x6f4 . ?\e,LB\e(B)
700 (#x6f5 . ?\e,LC\e(B)
701 (#x6f6 . ?\e,L6\e(B)
702 (#x6f7 . ?\e,L2\e(B)
703 (#x6f8 . ?\e,LL\e(B)
704 (#x6f9 . ?\e,LK\e(B)
705 (#x6fa . ?\e,L7\e(B)
706 (#x6fb . ?\e,LH\e(B)
707 (#x6fc . ?\e,LM\e(B)
708 (#x6fd . ?\e,LI\e(B)
709 (#x6fe . ?\e,LG\e(B)
710 (#x6ff . ?\e,LJ\e(B)
711 ;; Greek
712 (#x7a1 . ?\e,F6\e(B)
713 (#x7a2 . ?\e,F8\e(B)
714 (#x7a3 . ?\e,F9\e(B)
715 (#x7a4 . ?\e,F:\e(B)
716 (#x7a5 . ?\e,FZ\e(B)
717 (#x7a7 . ?\e,F<\e(B)
718 (#x7a8 . ?\e,F>\e(B)
719 (#x7a9 . ?\e,F[\e(B)
720 (#x7ab . ?\e,F?\e(B)
721 (#x7ae . ?\e,F5\e(B)
722 (#x7af . ?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cd . ?\e$B"N\e(B)
811 (#x8ce . ?\e$B"M\e(B)
812 (#x8cf . ?\e$A!T\e(B)
813 (#x8d6 . ?\e$A!L\e(B)
814 (#x8da . ?\e$B">\e(B)
815 (#x8db . ?\e$B"?\e(B)
816 (#x8dc . ?\e$A!I\e(B)
817 (#x8dd . ?\e$A!H\e(B)
818 (#x8de . ?\e$A!D\e(B)
819 (#x8df . ?\e$A!E\e(B)
820 (#x8ef . ?\e$B"_\e(B)
821 (#x8f6 . ?\e$,1!R\e(B)
822 (#x8fb . ?\e$A!{\e(B)
823 (#x8fc . ?\e$A!|\e(B)
824 (#x8fd . ?\e$A!z\e(B)
825 (#x8fe . ?\e$A!}\e(B)
826 ;; Special
827 (#x9e0 . ?\e$A!t\e(B)
828 (#x9e1 . ?\e$(C"F\e(B)
829 (#x9e2 . ?\e$(GB*\e(B)
830 (#x9e3 . ?\e$(GB-\e(B)
831 (#x9e4 . ?\e$(GB.\e(B)
832 (#x9e5 . ?\e$(GB+\e(B)
833 (#x9e8 . ?\e$,1}d\e(B)
834 (#x9e9 . ?\e$(GB,\e(B)
835 (#x9ea . ?\e$A)<\e(B)
836 (#x9eb . ?\e$A)4\e(B)
837 (#x9ec . ?\e$A)0\e(B)
838 (#x9ed . ?\e$A)8\e(B)
839 (#x9ee . ?\e$A)`\e(B)
840 (#x9ef . ?\e$,1|Z\e(B)
841 (#x9f0 . ?\e$,1|[\e(B)
842 (#x9f1 . ?\e$A)$\e(B)
843 (#x9f2 . ?\e$,1|\\e(B)
844 (#x9f3 . ?\e$,1|]\e(B)
845 (#x9f4 . ?\e$A)@\e(B)
846 (#x9f5 . ?\e$A)H\e(B)
847 (#x9f6 . ?\e$A)X\e(B)
848 (#x9f7 . ?\e$A)P\e(B)
849 (#x9f8 . ?\e$A)&\e(B)
850 ;; Publishing
851 (#xaa1 . ?\e$,1rc\e(B)
852 (#xaa2 . ?\e$,1rb\e(B)
853 (#xaa3 . ?\e$,1rd\e(B)
854 (#xaa4 . ?\e$,1re\e(B)
855 (#xaa5 . ?\e$,1rg\e(B)
856 (#xaa6 . ?\e$,1rh\e(B)
857 (#xaa7 . ?\e$,1ri\e(B)
858 (#xaa8 . ?\e$,1rj\e(B)
859 (#xaa9 . ?\e$(G!7\e(B)
860 (#xaaa . ?\e$(G!9\e(B)
861 (#xaae . ?\e$A!-\e(B)
862 (#xaaf . ?\e$(G!-\e(B)
863 (#xab0 . ?\e$(O'x\e(B)
864 (#xab1 . ?\e$(O'y\e(B)
865 (#xab2 . ?\e$(O'z\e(B)
866 (#xab3 . ?\e$,1v6\e(B)
867 (#xab4 . ?\e$,1v7\e(B)
868 (#xab5 . ?\e$,1v8\e(B)
869 (#xab6 . ?\e$,1v9\e(B)
870 (#xab7 . ?\e$,1v:\e(B)
871 (#xab8 . ?\e$(G""\e(B)
872 (#xabb . ?\e$,1rr\e(B)
873 (#xabc . ?\e$,1{)\e(B)
874 (#xabe . ?\e$,1{*\e(B)
875 (#xac3 . ?\e$(C({\e(B)
876 (#xac4 . ?\e$(C(|\e(B)
877 (#xac5 . ?\e$(C(}\e(B)
878 (#xac6 . ?\e$(C(~\e(B)
879 (#xac9 . ?\e$(D"o\e(B)
880 (#xaca . ?\e$,2"s\e(B)
881 (#xacc . ?\e$(O##\e(B)
882 (#xacd . ?\e$(O#!\e(B)
883 (#xace . ?\e$A!p\e(B)
884 (#xacf . ?\e$,2!o\e(B)
885 (#xad0 . ?\e,F!\e(B)
886 (#xad1 . ?\e,F"\e(B)
887 (#xad2 . ?\e,Y4\e(B)
888 (#xad3 . ?\e,Y!\e(B)
889 (#xad4 . ?\e$,1u^\e(B)
890 (#xad6 . ?\e$A!d\e(B)
891 (#xad7 . ?\e$A!e\e(B)
892 (#xad9 . ?\e$,2%]\e(B)
893 (#xadb . ?\e$,2!l\e(B)
894 (#xadc . ?\e$(O#$\e(B)
895 (#xadd . ?\e$(O#"\e(B)
896 (#xade . ?\e$A!q\e(B)
897 (#xadf . ?\e$,2!n\e(B)
898 (#xae0 . ?\e$(O#?\e(B)
899 (#xae1 . ?\e$,2!k\e(B)
900 (#xae2 . ?\e$,2!m\e(B)
901 (#xae3 . ?\e$A!w\e(B)
902 (#xae4 . ?\e$(G!}\e(B)
903 (#xae5 . ?\e$A!n\e(B)
904 (#xae6 . ?\e$(O#@\e(B)
905 (#xae7 . ?\e$,2!j\e(B)
906 (#xae8 . ?\e$A!x\e(B)
907 (#xae9 . ?\e$(G!~\e(B)
908 (#xaea . ?\e$(C"P\e(B)
909 (#xaeb . ?\e$(O-~\e(B)
910 (#xaec . ?\e$(O&@\e(B)
911 (#xaed . ?\e$(O&<\e(B)
912 (#xaee . ?\e$(O&>\e(B)
913 (#xaf0 . ?\e$,2%`\e(B)
914 (#xaf1 . ?\e$B"w\e(B)
915 (#xaf2 . ?\e$B"x\e(B)
916 (#xaf3 . ?\e$(O'{\e(B)
917 (#xaf4 . ?\e$,2%W\e(B)
918 (#xaf5 . ?\e$B"t\e(B)
919 (#xaf6 . ?\e$B"u\e(B)
920 (#xaf7 . ?\e$A!a\e(B)
921 (#xaf8 . ?\e$A!b\e(B)
922 (#xaf9 . ?\e$(O&g\e(B)
923 (#xafa . ?\e$,1zu\e(B)
924 (#xafb . ?\e$,1uW\e(B)
925 (#xafc . ?\e$,1s8\e(B)
926 (#xafd . ?\e$,1rz\e(B)
927 (#xafe . ?\e,Y%\e(B)
928 ;; APL
929 (#xba3 . ?<)
930 (#xba6 . ?>)
931 (#xba8 . ?\e$A!E\e(B)
932 (#xba9 . ?\e$A!D\e(B)
933 (#xbc0 . ?\e,A/\e(B)
934 (#xbc2 . ?\e$A!M\e(B)
935 (#xbc3 . ?\e$A!I\e(B)
936 (#xbc4 . ?\e$,1zj\e(B)
937 (#xbc6 . ?_)
938 (#xbca . ?\e$,1x8\e(B)
939 (#xbcc . ?\e$,1|5\e(B)
940 (#xbce . ?\e$,1yd\e(B)
941 (#xbcf . ?\e$A!p\e(B)
942 (#xbd3 . ?\e$,1zh\e(B)
943 (#xbd6 . ?\e$A!H\e(B)
944 (#xbd8 . ?\e$B"?\e(B)
945 (#xbda . ?\e$B">\e(B)
946 (#xbdc . ?\e$,1yb\e(B)
947 (#xbfc . ?\e$,1yc\e(B)
948 ;; Hebrew
949 (#xcdf . ?\e,H_\e(B)
950 (#xce0 . ?\e,H`\e(B)
951 (#xce1 . ?\e,Ha\e(B)
952 (#xce2 . ?\e,Hb\e(B)
953 (#xce3 . ?\e,Hc\e(B)
954 (#xce4 . ?\e,Hd\e(B)
955 (#xce5 . ?\e,He\e(B)
956 (#xce6 . ?\e,Hf\e(B)
957 (#xce7 . ?\e,Hg\e(B)
958 (#xce8 . ?\e,Hh\e(B)
959 (#xce9 . ?\e,Hi\e(B)
960 (#xcea . ?\e,Hj\e(B)
961 (#xceb . ?\e,Hk\e(B)
962 (#xcec . ?\e,Hl\e(B)
963 (#xced . ?\e,Hm\e(B)
964 (#xcee . ?\e,Hn\e(B)
965 (#xcef . ?\e,Ho\e(B)
966 (#xcf0 . ?\e,Hp\e(B)
967 (#xcf1 . ?\e,Hq\e(B)
968 (#xcf2 . ?\e,Hr\e(B)
969 (#xcf3 . ?\e,Hs\e(B)
970 (#xcf4 . ?\e,Ht\e(B)
971 (#xcf5 . ?\e,Hu\e(B)
972 (#xcf6 . ?\e,Hv\e(B)
973 (#xcf7 . ?\e,Hw\e(B)
974 (#xcf8 . ?\e,Hx\e(B)
975 (#xcf9 . ?\e,Hy\e(B)
976 (#xcfa . ?\e,Hz\e(B)
977 ;; Thai
978 (#xda1 . ?\e,T!\e(B)
979 (#xda2 . ?\e,T"\e(B)
980 (#xda3 . ?\e,T#\e(B)
981 (#xda4 . ?\e,T$\e(B)
982 (#xda5 . ?\e,T%\e(B)
983 (#xda6 . ?\e,T&\e(B)
984 (#xda7 . ?\e,T'\e(B)
985 (#xda8 . ?\e,T(\e(B)
986 (#xda9 . ?\e,T)\e(B)
987 (#xdaa . ?\e,T*\e(B)
988 (#xdab . ?\e,T+\e(B)
989 (#xdac . ?\e,T,\e(B)
990 (#xdad . ?\e,T-\e(B)
991 (#xdae . ?\e,T.\e(B)
992 (#xdaf . ?\e,T/\e(B)
993 (#xdb0 . ?\e,T0\e(B)
994 (#xdb1 . ?\e,T1\e(B)
995 (#xdb2 . ?\e,T2\e(B)
996 (#xdb3 . ?\e,T3\e(B)
997 (#xdb4 . ?\e,T4\e(B)
998 (#xdb5 . ?\e,T5\e(B)
999 (#xdb6 . ?\e,T6\e(B)
1000 (#xdb7 . ?\e,T7\e(B)
1001 (#xdb8 . ?\e,T8\e(B)
1002 (#xdb9 . ?\e,T9\e(B)
1003 (#xdba . ?\e,T:\e(B)
1004 (#xdbb . ?\e,T;\e(B)
1005 (#xdbc . ?\e,T<\e(B)
1006 (#xdbd . ?\e,T=\e(B)
1007 (#xdbe . ?\e,T>\e(B)
1008 (#xdbf . ?\e,T?\e(B)
1009 (#xdc0 . ?\e,T@\e(B)
1010 (#xdc1 . ?\e,TA\e(B)
1011 (#xdc2 . ?\e,TB\e(B)
1012 (#xdc3 . ?\e,TC\e(B)
1013 (#xdc4 . ?\e,TD\e(B)
1014 (#xdc5 . ?\e,TE\e(B)
1015 (#xdc6 . ?\e,TF\e(B)
1016 (#xdc7 . ?\e,TG\e(B)
1017 (#xdc8 . ?\e,TH\e(B)
1018 (#xdc9 . ?\e,TI\e(B)
1019 (#xdca . ?\e,TJ\e(B)
1020 (#xdcb . ?\e,TK\e(B)
1021 (#xdcc . ?\e,TL\e(B)
1022 (#xdcd . ?\e,TM\e(B)
1023 (#xdce . ?\e,TN\e(B)
1024 (#xdcf . ?\e,TO\e(B)
1025 (#xdd0 . ?\e,TP\e(B)
1026 (#xdd1 . ?\e,TQ\e(B)
1027 (#xdd2 . ?\e,TR\e(B)
1028 (#xdd3 . ?\e,TS\e(B)
1029 (#xdd4 . ?\e,TT\e(B)
1030 (#xdd5 . ?\e,TU\e(B)
1031 (#xdd6 . ?\e,TV\e(B)
1032 (#xdd7 . ?\e,TW\e(B)
1033 (#xdd8 . ?\e,TX\e(B)
1034 (#xdd9 . ?\e,TY\e(B)
1035 (#xdda . ?\e,TZ\e(B)
1036 (#xddf . ?\e,T_\e(B)
1037 (#xde0 . ?\e,T`\e(B)
1038 (#xde1 . ?\e,Ta\e(B)
1039 (#xde2 . ?\e,Tb\e(B)
1040 (#xde3 . ?\e,Tc\e(B)
1041 (#xde4 . ?\e,Td\e(B)
1042 (#xde5 . ?\e,Te\e(B)
1043 (#xde6 . ?\e,Tf\e(B)
1044 (#xde7 . ?\e,Tg\e(B)
1045 (#xde8 . ?\e,Th\e(B)
1046 (#xde9 . ?\e,Ti\e(B)
1047 (#xdea . ?\e,Tj\e(B)
1048 (#xdeb . ?\e,Tk\e(B)
1049 (#xdec . ?\e,Tl\e(B)
1050 (#xded . ?\e,Tm\e(B)
1051 (#xdf0 . ?\e,Tp\e(B)
1052 (#xdf1 . ?\e,Tq\e(B)
1053 (#xdf2 . ?\e,Tr\e(B)
1054 (#xdf3 . ?\e,Ts\e(B)
1055 (#xdf4 . ?\e,Tt\e(B)
1056 (#xdf5 . ?\e,Tu\e(B)
1057 (#xdf6 . ?\e,Tv\e(B)
1058 (#xdf7 . ?\e,Tw\e(B)
1059 (#xdf8 . ?\e,Tx\e(B)
1060 (#xdf9 . ?\e,Ty\e(B)
1061 ;; Korean
1062 (#xea1 . ?\e$(C$!\e(B)
1063 (#xea2 . ?\e$(C$"\e(B)
1064 (#xea3 . ?\e$(C$#\e(B)
1065 (#xea4 . ?\e$(C$$\e(B)
1066 (#xea5 . ?\e$(C$%\e(B)
1067 (#xea6 . ?\e$(C$&\e(B)
1068 (#xea7 . ?\e$(C$'\e(B)
1069 (#xea8 . ?\e$(C$(\e(B)
1070 (#xea9 . ?\e$(C$)\e(B)
1071 (#xeaa . ?\e$(C$*\e(B)
1072 (#xeab . ?\e$(C$+\e(B)
1073 (#xeac . ?\e$(C$,\e(B)
1074 (#xead . ?\e$(C$-\e(B)
1075 (#xeae . ?\e$(C$.\e(B)
1076 (#xeaf . ?\e$(C$/\e(B)
1077 (#xeb0 . ?\e$(C$0\e(B)
1078 (#xeb1 . ?\e$(C$1\e(B)
1079 (#xeb2 . ?\e$(C$2\e(B)
1080 (#xeb3 . ?\e$(C$3\e(B)
1081 (#xeb4 . ?\e$(C$4\e(B)
1082 (#xeb5 . ?\e$(C$5\e(B)
1083 (#xeb6 . ?\e$(C$6\e(B)
1084 (#xeb7 . ?\e$(C$7\e(B)
1085 (#xeb8 . ?\e$(C$8\e(B)
1086 (#xeb9 . ?\e$(C$9\e(B)
1087 (#xeba . ?\e$(C$:\e(B)
1088 (#xebb . ?\e$(C$;\e(B)
1089 (#xebc . ?\e$(C$<\e(B)
1090 (#xebd . ?\e$(C$=\e(B)
1091 (#xebe . ?\e$(C$>\e(B)
1092 (#xebf . ?\e$(C$?\e(B)
1093 (#xec0 . ?\e$(C$@\e(B)
1094 (#xec1 . ?\e$(C$A\e(B)
1095 (#xec2 . ?\e$(C$B\e(B)
1096 (#xec3 . ?\e$(C$C\e(B)
1097 (#xec4 . ?\e$(C$D\e(B)
1098 (#xec5 . ?\e$(C$E\e(B)
1099 (#xec6 . ?\e$(C$F\e(B)
1100 (#xec7 . ?\e$(C$G\e(B)
1101 (#xec8 . ?\e$(C$H\e(B)
1102 (#xec9 . ?\e$(C$I\e(B)
1103 (#xeca . ?\e$(C$J\e(B)
1104 (#xecb . ?\e$(C$K\e(B)
1105 (#xecc . ?\e$(C$L\e(B)
1106 (#xecd . ?\e$(C$M\e(B)
1107 (#xece . ?\e$(C$N\e(B)
1108 (#xecf . ?\e$(C$O\e(B)
1109 (#xed0 . ?\e$(C$P\e(B)
1110 (#xed1 . ?\e$(C$Q\e(B)
1111 (#xed2 . ?\e$(C$R\e(B)
1112 (#xed3 . ?\e$(C$S\e(B)
1113 (#xed4 . ?\e$,1LH\e(B)
1114 (#xed5 . ?\e$,1LI\e(B)
1115 (#xed6 . ?\e$,1LJ\e(B)
1116 (#xed7 . ?\e$,1LK\e(B)
1117 (#xed8 . ?\e$,1LL\e(B)
1118 (#xed9 . ?\e$,1LM\e(B)
1119 (#xeda . ?\e$,1LN\e(B)
1120 (#xedb . ?\e$,1LO\e(B)
1121 (#xedc . ?\e$,1LP\e(B)
1122 (#xedd . ?\e$,1LQ\e(B)
1123 (#xede . ?\e$,1LR\e(B)
1124 (#xedf . ?\e$,1LS\e(B)
1125 (#xee0 . ?\e$,1LT\e(B)
1126 (#xee1 . ?\e$,1LU\e(B)
1127 (#xee2 . ?\e$,1LV\e(B)
1128 (#xee3 . ?\e$,1LW\e(B)
1129 (#xee4 . ?\e$,1LX\e(B)
1130 (#xee5 . ?\e$,1LY\e(B)
1131 (#xee6 . ?\e$,1LZ\e(B)
1132 (#xee7 . ?\e$,1L[\e(B)
1133 (#xee8 . ?\e$,1L\\e(B)
1134 (#xee9 . ?\e$,1L]\e(B)
1135 (#xeea . ?\e$,1L^\e(B)
1136 (#xeeb . ?\e$,1L_\e(B)
1137 (#xeec . ?\e$,1L`\e(B)
1138 (#xeed . ?\e$,1La\e(B)
1139 (#xeee . ?\e$,1Lb\e(B)
1140 (#xeef . ?\e$(C$]\e(B)
1141 (#xef0 . ?\e$(C$a\e(B)
1142 (#xef1 . ?\e$(C$h\e(B)
1143 (#xef2 . ?\e$(C$o\e(B)
1144 (#xef3 . ?\e$(C$q\e(B)
1145 (#xef4 . ?\e$(C$t\e(B)
1146 (#xef5 . ?\e$(C$v\e(B)
1147 (#xef6 . ?\e$(C$}\e(B)
1148 (#xef7 . ?\e$(C$~\e(B)
1149 (#xef8 . ?\e$,1M+\e(B)
1150 (#xef9 . ?\e$,1M0\e(B)
1151 (#xefa . ?\e$,1M9\e(B)
1152 (#xeff . ?\e$,1tI\e(B)
1153 ;; Latin-5
1154 ;; Latin-6
1155 ;; Latin-7
1156 ;; Latin-8
1157 ;; Latin-9
1158 (#x13bc . ?\e,b<\e(B)
1159 (#x13bd . ?\e,b=\e(B)
1160 (#x13be . ?\e,_/\e(B)
1161 ;; Currency
1162 (#x20a0 . ?\e$,1t@\e(B)
1163 (#x20a1 . ?\e$,1tA\e(B)
1164 (#x20a2 . ?\e$,1tB\e(B)
1165 (#x20a3 . ?\e$,1tC\e(B)
1166 (#x20a4 . ?\e$,1tD\e(B)
1167 (#x20a5 . ?\e$,1tE\e(B)
1168 (#x20a6 . ?\e$,1tF\e(B)
1169 (#x20a7 . ?\e$,1tG\e(B)
1170 (#x20a8 . ?\e$,1tH\e(B)
1171 (#x20aa . ?\e$,1tJ\e(B)
1172 (#x20ab . ?\e$,1tK\e(B)
1173 (#x20ac . ?\e,b$\e(B)))
1174 (puthash (car pair) (cdr pair) x-keysym-table))
1175
1176 ;; The following keysym codes for graphics are listed in the document
1177 ;; as not having unicodes available:
1178
1179 ;; #x08b1 TOP LEFT SUMMATION Technical
1180 ;; #x08b2 BOTTOM LEFT SUMMATION Technical
1181 ;; #x08b3 TOP VERTICAL SUMMATION CONNECTOR Technical
1182 ;; #x08b4 BOTTOM VERTICAL SUMMATION CONNECTOR Technical
1183 ;; #x08b5 TOP RIGHT SUMMATION Technical
1184 ;; #x08b6 BOTTOM RIGHT SUMMATION Technical
1185 ;; #x08b7 RIGHT MIDDLE SUMMATION Technical
1186 ;; #x0aac SIGNIFICANT BLANK SYMBOL Publish
1187 ;; #x0abd DECIMAL POINT Publish
1188 ;; #x0abf MARKER Publish
1189 ;; #x0acb TRADEMARK SIGN IN CIRCLE Publish
1190 ;; #x0ada HEXAGRAM Publish
1191 ;; #x0aff CURSOR Publish
1192 ;; #x0dde THAI MAIHANAKAT Thai
1193
1194 \f
1195 ;;;; Selections and cut buffers
1196
1197 ;; We keep track of the last text selected here, so we can check the
1198 ;; current selection against it, and avoid passing back our own text
1199 ;; from x-cut-buffer-or-selection-value. We track all three
1200 ;; separately in case another X application only sets one of them
1201 ;; (say the cut buffer) we aren't fooled by the PRIMARY or
1202 ;; CLIPBOARD selection staying the same.
1203 (defvar x-last-selected-text-clipboard nil
1204 "The value of the CLIPBOARD X selection last time we selected or
1205 pasted text.")
1206 (defvar x-last-selected-text-primary nil
1207 "The value of the PRIMARY X selection last time we selected or
1208 pasted text.")
1209 (defvar x-last-selected-text-cut nil
1210 "The value of the X cut buffer last time we selected or pasted text.
1211 The actual text stored in the X cut buffer is what encoded from this value.")
1212 (defvar x-last-selected-text-cut-encoded nil
1213 "The value of the X cut buffer last time we selected or pasted text.
1214 This is the actual text stored in the X cut buffer.")
1215 (defvar x-last-cut-buffer-coding 'iso-latin-1
1216 "The coding we last used to encode/decode the text from the X cut buffer")
1217
1218 (defvar x-cut-buffer-max 20000 ; Note this value is overridden below.
1219 "Max number of characters to put in the cut buffer.
1220 It is said that overlarge strings are slow to put into the cut buffer.")
1221
1222 (defcustom x-select-enable-clipboard t
1223 "Non-nil means cutting and pasting uses the clipboard.
1224 This is in addition to, but in preference to, the primary selection."
1225 :type 'boolean
1226 :group 'killing)
1227
1228 (defcustom x-select-enable-primary t
1229 "Non-nil means cutting and pasting uses the primary selection."
1230 :type 'boolean
1231 :group 'killing)
1232
1233 (defun x-select-text (text &optional push)
1234 "Select TEXT, a string, according to the window system.
1235
1236 On X, put TEXT in the primary X selection. For backward
1237 compatibility with older X applications, set the value of X cut
1238 buffer 0 as well, and if the optional argument PUSH is non-nil,
1239 rotate the cut buffers. If `x-select-enable-clipboard' is
1240 non-nil, copy the text to the X clipboard as well.
1241
1242 On Windows, make TEXT the current selection. If
1243 `x-select-enable-clipboard' is non-nil, copy the text to the
1244 clipboard as well. The argument PUSH is ignored.
1245
1246 On Nextstep, put TEXT in the pasteboard; PUSH is ignored."
1247 ;; With multi-tty, this function may be called from a tty frame.
1248 (when (eq (framep (selected-frame)) 'x)
1249 ;; Don't send the cut buffer too much text.
1250 ;; It becomes slow, and if really big it causes errors.
1251 (cond ((>= (length text) x-cut-buffer-max)
1252 (x-set-cut-buffer "" push)
1253 (setq x-last-selected-text-cut ""
1254 x-last-selected-text-cut-encoded ""))
1255 (t
1256 (setq x-last-selected-text-cut text
1257 x-last-cut-buffer-coding 'iso-latin-1
1258 x-last-selected-text-cut-encoded
1259 ;; ICCCM says cut buffer always contain ISO-Latin-1
1260 (encode-coding-string text 'iso-latin-1))
1261 (x-set-cut-buffer x-last-selected-text-cut-encoded push)))
1262 (when x-select-enable-primary
1263 (x-set-selection 'PRIMARY text)
1264 (setq x-last-selected-text-primary text))
1265 (when x-select-enable-clipboard
1266 (x-set-selection 'CLIPBOARD text)
1267 (setq x-last-selected-text-clipboard text))))
1268
1269 (defvar x-select-request-type nil
1270 "*Data type request for X selection.
1271 The value is one of the following data types, a list of them, or nil:
1272 `COMPOUND_TEXT', `UTF8_STRING', `STRING', `TEXT'
1273
1274 If the value is one of the above symbols, try only the specified
1275 type.
1276
1277 If the value is a list of them, try each of them in the specified
1278 order until succeed.
1279
1280 The value nil is the same as this list:
1281 \(UTF8_STRING COMPOUND_TEXT STRING)
1282 ")
1283
1284 ;; Get a selection value of type TYPE by calling x-get-selection with
1285 ;; an appropriate DATA-TYPE argument decided by `x-select-request-type'.
1286 ;; The return value is already decoded. If x-get-selection causes an
1287 ;; error, this function return nil.
1288
1289 (defun x-selection-value (type)
1290 (let ((request-type (or x-select-request-type
1291 '(UTF8_STRING COMPOUND_TEXT STRING)))
1292 text)
1293 (if (consp request-type)
1294 (while (and request-type (not text))
1295 (condition-case nil
1296 (setq text (x-get-selection type (car request-type)))
1297 (error nil))
1298 (setq request-type (cdr request-type)))
1299 (condition-case nil
1300 (setq text (x-get-selection type request-type))
1301 (error nil)))
1302 (if text
1303 (remove-text-properties 0 (length text) '(foreign-selection nil) text))
1304 text))
1305
1306 ;; Return the value of the current X selection.
1307 ;; Consult the selection, and the cut buffer. Treat empty strings
1308 ;; as if they were unset.
1309 ;; If this function is called twice and finds the same text,
1310 ;; it returns nil the second time. This is so that a single
1311 ;; selection won't be added to the kill ring over and over.
1312 (defun x-cut-buffer-or-selection-value ()
1313 ;; With multi-tty, this function may be called from a tty frame.
1314 (when (eq (framep (selected-frame)) 'x)
1315 (let (clip-text primary-text cut-text)
1316 (when x-select-enable-clipboard
1317 (setq clip-text (x-selection-value 'CLIPBOARD))
1318 (if (string= clip-text "") (setq clip-text nil))
1319
1320 ;; Check the CLIPBOARD selection for 'newness', is it different
1321 ;; from what we remebered them to be last time we did a
1322 ;; cut/paste operation.
1323 (setq clip-text
1324 (cond ;; check clipboard
1325 ((or (not clip-text) (string= clip-text ""))
1326 (setq x-last-selected-text-clipboard nil))
1327 ((eq clip-text x-last-selected-text-clipboard) nil)
1328 ((string= clip-text x-last-selected-text-clipboard)
1329 ;; Record the newer string,
1330 ;; so subsequent calls can use the `eq' test.
1331 (setq x-last-selected-text-clipboard clip-text)
1332 nil)
1333 (t (setq x-last-selected-text-clipboard clip-text)))))
1334
1335 (when x-select-enable-primary
1336 (setq primary-text (x-selection-value 'PRIMARY))
1337 ;; Check the PRIMARY selection for 'newness', is it different
1338 ;; from what we remebered them to be last time we did a
1339 ;; cut/paste operation.
1340 (setq primary-text
1341 (cond ;; check primary selection
1342 ((or (not primary-text) (string= primary-text ""))
1343 (setq x-last-selected-text-primary nil))
1344 ((eq primary-text x-last-selected-text-primary) nil)
1345 ((string= primary-text x-last-selected-text-primary)
1346 ;; Record the newer string,
1347 ;; so subsequent calls can use the `eq' test.
1348 (setq x-last-selected-text-primary primary-text)
1349 nil)
1350 (t
1351 (setq x-last-selected-text-primary primary-text)))))
1352
1353 (setq cut-text (x-get-cut-buffer 0))
1354
1355 ;; Check the x cut buffer for 'newness', is it different
1356 ;; from what we remebered them to be last time we did a
1357 ;; cut/paste operation.
1358 (setq cut-text
1359 (let ((next-coding (or next-selection-coding-system 'iso-latin-1)))
1360 (cond ;; check cut buffer
1361 ((or (not cut-text) (string= cut-text ""))
1362 (setq x-last-selected-text-cut nil))
1363 ;; This short cut doesn't work because x-get-cut-buffer
1364 ;; always returns a newly created string.
1365 ;; ((eq cut-text x-last-selected-text-cut) nil)
1366 ((and (string= cut-text x-last-selected-text-cut-encoded)
1367 (eq x-last-cut-buffer-coding next-coding))
1368 ;; See the comment above. No need of this recording.
1369 ;; Record the newer string,
1370 ;; so subsequent calls can use the `eq' test.
1371 ;; (setq x-last-selected-text-cut cut-text)
1372 nil)
1373 (t
1374 (setq x-last-selected-text-cut-encoded cut-text
1375 x-last-cut-buffer-coding next-coding
1376 x-last-selected-text-cut
1377 ;; ICCCM says cut buffer always contain ISO-Latin-1, but
1378 ;; use next-selection-coding-system if not nil.
1379 (decode-coding-string
1380 cut-text next-coding))))))
1381
1382 ;; As we have done one selection, clear this now.
1383 (setq next-selection-coding-system nil)
1384
1385 ;; At this point we have recorded the current values for the
1386 ;; selection from clipboard (if we are supposed to) primary,
1387 ;; and cut buffer. So return the first one that has changed
1388 ;; (which is the first non-null one).
1389 ;;
1390 ;; NOTE: There will be cases where more than one of these has
1391 ;; changed and the new values differ. This indicates that
1392 ;; something like the following has happened since the last time
1393 ;; we looked at the selections: Application X set all the
1394 ;; selections, then Application Y set only one or two of them (say
1395 ;; just the cut-buffer). In this case since we don't have
1396 ;; timestamps there is no way to know what the 'correct' value to
1397 ;; return is. The nice thing to do would be to tell the user we
1398 ;; saw multiple possible selections and ask the user which was the
1399 ;; one they wanted.
1400 ;; This code is still a big improvement because now the user can
1401 ;; futz with the current selection and get emacs to pay attention
1402 ;; to the cut buffer again (previously as soon as clipboard or
1403 ;; primary had been set the cut buffer would essentially never be
1404 ;; checked again).
1405 (or clip-text primary-text cut-text)
1406 )))
1407
1408 ;; Arrange for the kill and yank functions to set and check the clipboard.
1409 (setq interprogram-cut-function 'x-select-text)
1410 (setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
1411
1412 (defun x-clipboard-yank ()
1413 "Insert the clipboard contents, or the last stretch of killed text."
1414 (interactive "*")
1415 (let ((clipboard-text (x-selection-value 'CLIPBOARD))
1416 (x-select-enable-clipboard t))
1417 (if (and clipboard-text (> (length clipboard-text) 0))
1418 (kill-new clipboard-text))
1419 (yank)))
1420
1421 (declare-function accelerate-menu "xmenu.c" (&optional frame) t)
1422
1423 (defun x-menu-bar-open (&optional frame)
1424 "Open the menu bar if `menu-bar-mode' is on, otherwise call `tmm-menubar'."
1425 (interactive "i")
1426 (if (and menu-bar-mode
1427 (fboundp 'accelerate-menu))
1428 (accelerate-menu frame)
1429 (tmm-menubar)))
1430
1431 \f
1432 ;;; Window system initialization.
1433
1434 (defun x-win-suspend-error ()
1435 ;; Don't allow suspending if any of the frames are X frames.
1436 (if (memq 'x (mapcar 'window-system (frame-list)))
1437 (error "Cannot suspend Emacs while running under X")))
1438
1439 (defvar x-initialized nil
1440 "Non-nil if the X window system has been initialized.")
1441
1442 (declare-function x-open-connection "xfns.c"
1443 (display &optional xrm-string must-succeed))
1444 (declare-function x-server-max-request-size "xfns.c" (&optional terminal))
1445 (declare-function x-get-resource "frame.c"
1446 (attribute class &optional component subclass))
1447 (declare-function x-parse-geometry "frame.c" (string))
1448 (defvar x-resource-name)
1449 (defvar x-display-name)
1450 (defvar x-command-line-resources)
1451
1452 (defun x-initialize-window-system ()
1453 "Initialize Emacs for X frames and open the first connection to an X server."
1454 ;; Make sure we have a valid resource name.
1455 (or (stringp x-resource-name)
1456 (let (i)
1457 (setq x-resource-name (invocation-name))
1458
1459 ;; Change any . or * characters in x-resource-name to hyphens,
1460 ;; so as not to choke when we use it in X resource queries.
1461 (while (setq i (string-match "[.*]" x-resource-name))
1462 (aset x-resource-name i ?-))))
1463
1464 (x-open-connection (or x-display-name
1465 (setq x-display-name (or (getenv "DISPLAY" (selected-frame))
1466 (getenv "DISPLAY"))))
1467 x-command-line-resources
1468 ;; Exit Emacs with fatal error if this fails and we
1469 ;; are the initial display.
1470 (eq initial-window-system 'x))
1471
1472 (setq x-cut-buffer-max (min (- (/ (x-server-max-request-size) 2) 100)
1473 x-cut-buffer-max))
1474
1475 ;; Create the default fontset.
1476 (create-default-fontset)
1477
1478 ;; Create the standard fontset.
1479 (condition-case err
1480 (create-fontset-from-fontset-spec standard-fontset-spec t)
1481 (error (display-warning
1482 'initialization
1483 (format "Creation of the standard fontset failed: %s" err)
1484 :error)))
1485
1486 ;; Create fontset specified in X resources "Fontset-N" (N is 0, 1, ...).
1487 (create-fontset-from-x-resource)
1488
1489 ;; Set scroll bar mode to right if set by X resources. Default is left.
1490 (if (equal (x-get-resource "verticalScrollBars" "ScrollBars") "right")
1491 (customize-set-variable 'scroll-bar-mode 'right))
1492
1493 ;; Apply a geometry resource to the initial frame. Put it at the end
1494 ;; of the alist, so that anything specified on the command line takes
1495 ;; precedence.
1496 (let* ((res-geometry (x-get-resource "geometry" "Geometry"))
1497 parsed)
1498 (if res-geometry
1499 (progn
1500 (setq parsed (x-parse-geometry res-geometry))
1501 ;; If the resource specifies a position,
1502 ;; call the position and size "user-specified".
1503 (if (or (assq 'top parsed) (assq 'left parsed))
1504 (setq parsed (cons '(user-position . t)
1505 (cons '(user-size . t) parsed))))
1506 ;; All geometry parms apply to the initial frame.
1507 (setq initial-frame-alist (append initial-frame-alist parsed))
1508 ;; The size parms apply to all frames. Don't set it if there are
1509 ;; sizes there already (from command line).
1510 (if (and (assq 'height parsed)
1511 (not (assq 'height default-frame-alist)))
1512 (setq default-frame-alist
1513 (cons (cons 'height (cdr (assq 'height parsed)))
1514 default-frame-alist)))
1515 (if (and (assq 'width parsed)
1516 (not (assq 'width default-frame-alist)))
1517 (setq default-frame-alist
1518 (cons (cons 'width (cdr (assq 'width parsed)))
1519 default-frame-alist))))))
1520
1521 ;; Check the reverseVideo resource.
1522 (let ((case-fold-search t))
1523 (let ((rv (x-get-resource "reverseVideo" "ReverseVideo")))
1524 (if (and rv
1525 (string-match "^\\(true\\|yes\\|on\\)$" rv))
1526 (setq default-frame-alist
1527 (cons '(reverse . t) default-frame-alist)))))
1528
1529 ;; Set x-selection-timeout, measured in milliseconds.
1530 (let ((res-selection-timeout
1531 (x-get-resource "selectionTimeout" "SelectionTimeout")))
1532 (setq x-selection-timeout 20000)
1533 (if res-selection-timeout
1534 (setq x-selection-timeout (string-to-number res-selection-timeout))))
1535
1536 ;; Don't let Emacs suspend under X.
1537 (add-hook 'suspend-hook 'x-win-suspend-error)
1538
1539 ;; During initialization, we defer sending size hints to the window
1540 ;; manager, because that can induce a race condition:
1541 ;; http://lists.gnu.org/archive/html/emacs-devel/2008-10/msg00033.html
1542 ;; Send the size hints once initialization is done.
1543 (add-hook 'after-init-hook 'x-wm-set-size-hint)
1544
1545 ;; Turn off window-splitting optimization; X is usually fast enough
1546 ;; that this is only annoying.
1547 (setq split-window-keep-point t)
1548
1549 ;; Motif direct handling of f10 wasn't working right,
1550 ;; So temporarily we've turned it off in lwlib-Xm.c
1551 ;; and turned the Emacs f10 back on.
1552 ;; ;; Motif normally handles f10 itself, so don't try to handle it a second time.
1553 ;; (if (featurep 'motif)
1554 ;; (global-set-key [f10] 'ignore))
1555
1556 ;; Enable CLIPBOARD copy/paste through menu bar commands.
1557 (menu-bar-enable-clipboard)
1558
1559 ;; ;; Override Paste so it looks at CLIPBOARD first.
1560 ;; (define-key menu-bar-edit-menu [paste]
1561 ;; (append '(menu-item "Paste" x-clipboard-yank
1562 ;; :enable (not buffer-read-only)
1563 ;; :help "Paste (yank) text most recently cut/copied")
1564 ;; nil))
1565
1566 (setq x-initialized t))
1567
1568 (add-to-list 'handle-args-function-alist '(x . x-handle-args))
1569 (add-to-list 'frame-creation-function-alist '(x . x-create-frame-with-faces))
1570 (add-to-list 'window-system-initialization-alist '(x . x-initialize-window-system))
1571
1572 ;; Initiate drag and drop
1573 (add-hook 'after-make-frame-functions 'x-dnd-init-frame)
1574 (define-key special-event-map [drag-n-drop] 'x-dnd-handle-drag-n-drop-event)
1575
1576 (defcustom x-gtk-stock-map
1577 (mapcar (lambda (arg)
1578 (cons (purecopy (car arg)) (purecopy (cdr arg))))
1579 '(
1580 ("etc/images/new" . "gtk-new")
1581 ("etc/images/open" . "gtk-open")
1582 ("etc/images/diropen" . "n:system-file-manager")
1583 ("etc/images/close" . "gtk-close")
1584 ("etc/images/save" . "gtk-save")
1585 ("etc/images/saveas" . "gtk-save-as")
1586 ("etc/images/undo" . "gtk-undo")
1587 ("etc/images/cut" . "gtk-cut")
1588 ("etc/images/copy" . "gtk-copy")
1589 ("etc/images/paste" . "gtk-paste")
1590 ("etc/images/search" . "gtk-find")
1591 ("etc/images/print" . "gtk-print")
1592 ("etc/images/preferences" . "gtk-preferences")
1593 ("etc/images/help" . "gtk-help")
1594 ("etc/images/left-arrow" . "gtk-go-back")
1595 ("etc/images/right-arrow" . "gtk-go-forward")
1596 ("etc/images/home" . "gtk-home")
1597 ("etc/images/jump-to" . "gtk-jump-to")
1598 ("etc/images/index" . "gtk-index")
1599 ("etc/images/search" . "gtk-find")
1600 ("etc/images/exit" . "gtk-quit")
1601 ("etc/images/cancel" . "gtk-cancel")
1602 ("etc/images/info" . "gtk-info")
1603 ("etc/images/bookmark_add" . "n:bookmark_add")
1604 ;; Used in Gnus and/or MH-E:
1605 ("etc/images/attach" . "gtk-attach")
1606 ("etc/images/connect" . "gtk-connect")
1607 ("etc/images/contact" . "gtk-contact")
1608 ("etc/images/delete" . "gtk-delete")
1609 ("etc/images/describe" . "gtk-properties")
1610 ("etc/images/disconnect" . "gtk-disconnect")
1611 ;; ("etc/images/exit" . "gtk-exit")
1612 ("etc/images/lock-broken" . "gtk-lock_broken")
1613 ("etc/images/lock-ok" . "gtk-lock_ok")
1614 ("etc/images/lock" . "gtk-lock")
1615 ("etc/images/next-page" . "gtk-next-page")
1616 ("etc/images/refresh" . "gtk-refresh")
1617 ("etc/images/sort-ascending" . "gtk-sort-ascending")
1618 ("etc/images/sort-column-ascending" . "gtk-sort-column-ascending")
1619 ("etc/images/sort-criteria" . "gtk-sort-criteria")
1620 ("etc/images/sort-descending" . "gtk-sort-descending")
1621 ("etc/images/sort-row-ascending" . "gtk-sort-row-ascending")
1622 ("images/gnus/toggle-subscription" . "gtk-task-recurring")
1623 ("images/mail/compose" . "gtk-mail-compose")
1624 ("images/mail/copy" . "gtk-mail-copy")
1625 ("images/mail/forward" . "gtk-mail-forward")
1626 ("images/mail/inbox" . "gtk-inbox")
1627 ("images/mail/move" . "gtk-mail-move")
1628 ("images/mail/not-spam" . "gtk-not-spam")
1629 ("images/mail/outbox" . "gtk-outbox")
1630 ("images/mail/reply-all" . "gtk-mail-reply-to-all")
1631 ("images/mail/reply" . "gtk-mail-reply")
1632 ("images/mail/save-draft" . "gtk-mail-handling")
1633 ("images/mail/send" . "gtk-mail-send")
1634 ("images/mail/spam" . "gtk-spam")
1635 ;; Used for GDB Graphical Interface
1636 ("images/gud/break" . "gtk-no")
1637 ("images/gud/recstart" . "gtk-media-record")
1638 ("images/gud/recstop" . "gtk-media-stop")
1639 ;; No themed versions available:
1640 ;; mail/preview (combining stock_mail and stock_zoom)
1641 ;; mail/save (combining stock_mail, stock_save and stock_convert)
1642 ))
1643 "How icons for tool bars are mapped to Gtk+ stock items.
1644 Emacs must be compiled with the Gtk+ toolkit for this to have any effect.
1645 A value that begins with n: denotes a named icon instead of a stock icon."
1646 :version "22.2"
1647 :type '(choice (repeat (choice symbol
1648 (cons (string :tag "Emacs icon")
1649 (string :tag "Stock/named")))))
1650 :group 'x)
1651
1652 (defcustom icon-map-list '(x-gtk-stock-map)
1653 "A list of alists that map icon file names to stock/named icons.
1654 The alists are searched in the order they appear. The first match is used.
1655 The keys in the alists are file names without extension and with two directory
1656 components. For example, to map /usr/share/emacs/22.1.1/etc/images/open.xpm
1657 to stock item gtk-open, use:
1658
1659 (\"etc/images/open\" . \"gtk-open\")
1660
1661 Themes also have named icons. To map to one of those, use n: before the name:
1662
1663 (\"etc/images/diropen\" . \"n:system-file-manager\")
1664
1665 The list elements are either the symbol name for the alist or the
1666 alist itself.
1667
1668 If you don't want stock icons, set the variable to nil."
1669 :version "22.2"
1670 :type '(choice (const :tag "Don't use stock icons" nil)
1671 (repeat (choice symbol
1672 (cons (string :tag "Emacs icon")
1673 (string :tag "Stock/named")))))
1674 :group 'x)
1675
1676 (defconst x-gtk-stock-cache (make-hash-table :weakness t :test 'equal))
1677
1678 (defun x-gtk-map-stock (file)
1679 "Map icon with file name FILE to a Gtk+ stock name.
1680 This uses `icon-map-list' to map icon file names to stock icon names."
1681 (when (stringp file)
1682 (or (gethash file x-gtk-stock-cache)
1683 (puthash
1684 file
1685 (save-match-data
1686 (let* ((file-sans (file-name-sans-extension file))
1687 (key (and (string-match "/\\([^/]+/[^/]+/[^/]+$\\)"
1688 file-sans)
1689 (match-string 1 file-sans)))
1690 (icon-map icon-map-list)
1691 elem value)
1692 (while (and (null value) icon-map)
1693 (setq elem (car icon-map)
1694 value (assoc-string (or key file-sans)
1695 (if (symbolp elem)
1696 (symbol-value elem)
1697 elem))
1698 icon-map (cdr icon-map)))
1699 (and value (cdr value))))
1700 x-gtk-stock-cache))))
1701
1702 (provide 'x-win)
1703
1704 ;; arch-tag: f1501302-db8b-4d95-88e3-116697d89f78
1705 ;;; x-win.el ends here