1 ;;; x-win.el --- parse relevant switches and set up for X -*-coding: iso-2022-7bit;-*-
3 ;; Copyright (C) 1993-1994, 2001-2012 Free Software Foundation, Inc.
6 ;; Keywords: terminals, i18n
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software: you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation, either version 3 of the License, or
13 ;; (at your option) any later version.
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
25 ;; X-win.el: this file defines functions to initialize the X window
26 ;; system and process X-specific command line parameters before
27 ;; creating the first X frame.
29 ;; Beginning in Emacs 23, the act of loading this file should not have
30 ;; the side effect of initializing the window system or processing
31 ;; command line arguments (this file is now loaded in loadup.el). See
32 ;; the variables `handle-args-function-alist' and
33 ;; `window-system-initialization-alist' for more details.
35 ;; startup.el will then examine startup files, and eventually call the hooks
36 ;; which create the first window(s).
40 ;; These are the standard X switches from the Xt Initialize.c file of
43 ;; Command line Resource Manager string
46 ;; +synchronous *synchronous
47 ;; -background *background
50 ;; -bordercolor *borderColor
51 ;; -borderwidth .borderWidth
57 ;; -foreground *foreground
58 ;; -geometry .geometry
61 ;; -reverse *reverseVideo
63 ;; -selectionTimeout .selectionTimeout
64 ;; -synchronous *synchronous
67 ;; An alist of X options and the function which handles them. See
70 (if (not (fboundp 'x-create-frame
))
71 (error "%s: Loading x-win.el but not compiled for X" (invocation-name)))
82 (defvar x-invocation-args
)
83 (defvar x-keysym-table
)
84 (defvar x-selection-timeout
)
86 (defvar x-session-previous-id
)
88 (defun x-handle-no-bitmap-icon (switch)
89 (setq default-frame-alist
(cons '(icon-type) default-frame-alist
)))
91 ;; Handle the --parent-id option.
92 (defun x-handle-parent-id (switch)
93 (or (consp x-invocation-args
)
94 (error "%s: missing argument to `%s' option" (invocation-name) switch
))
95 (setq initial-frame-alist
(cons
97 (string-to-number (car x-invocation-args
)))
99 x-invocation-args
(cdr x-invocation-args
)))
101 ;; Handle the --smid switch. This is used by the session manager
102 ;; to give us back our session id we had on the previous run.
103 (defun x-handle-smid (switch)
104 (or (consp x-invocation-args
)
105 (error "%s: missing argument to `%s' option" (invocation-name) switch
))
106 (setq x-session-previous-id
(car x-invocation-args
)
107 x-invocation-args
(cdr x-invocation-args
)))
109 (defvar emacs-save-session-functions nil
110 "Special hook run when a save-session event occurs.
111 The functions do not get any argument.
112 Functions can return non-nil to inform the session manager that the
113 window system shutdown should be aborted.
115 See also `emacs-session-save'.")
117 (defun emacs-session-filename (session-id)
118 "Construct a filename to save the session in based on SESSION-ID.
119 If the directory ~/.emacs.d exists, we make a filename in there, otherwise
120 a file in the home directory."
121 (let ((basename (concat "session." session-id
))
122 (emacs-dir user-emacs-directory
))
123 (expand-file-name (if (file-directory-p emacs-dir
)
124 (concat emacs-dir basename
)
125 (concat "~/.emacs-" basename
)))))
127 (defun emacs-session-save ()
128 "This function is called when the window system is shutting down.
129 If this function returns non-nil, the window system shutdown is canceled.
131 When a session manager tells Emacs that the window system is shutting
132 down, this function is called. It calls the functions in the hook
133 `emacs-save-session-functions'. Functions are called with the current
134 buffer set to a temporary buffer. Functions should use `insert' to insert
135 lisp code to save the session state. The buffer is saved in a file in the
136 home directory of the user running Emacs. The file is evaluated when
137 Emacs is restarted by the session manager.
139 If any of the functions returns non-nil, no more functions are called
140 and this function returns non-nil. This will inform the session manager
141 that it should abort the window system shutdown."
142 (let ((filename (emacs-session-filename x-session-id
))
143 (buf (get-buffer-create (concat " *SES " x-session-id
))))
144 (when (file-exists-p filename
)
145 (delete-file filename
))
146 (with-current-buffer buf
147 (let ((cancel-shutdown (condition-case nil
148 ;; A return of t means cancel the shutdown.
149 (run-hook-with-args-until-success
150 'emacs-save-session-functions
)
152 (unless cancel-shutdown
153 (write-file filename
))
157 (defun emacs-session-restore (previous-session-id)
158 "Restore the Emacs session if started by a session manager.
159 The file saved by `emacs-session-save' is evaluated and deleted if it
161 (let ((filename (emacs-session-filename previous-session-id
)))
162 (when (file-exists-p filename
)
164 (delete-file filename
)
165 (message "Restored session data"))))
171 ;; Standard X cursor shapes, courtesy of Mr. Fox, who wanted ALL of them.
174 (defconst x-pointer-X-cursor
0)
175 (defconst x-pointer-arrow
2)
176 (defconst x-pointer-based-arrow-down
4)
177 (defconst x-pointer-based-arrow-up
6)
178 (defconst x-pointer-boat
8)
179 (defconst x-pointer-bogosity
10)
180 (defconst x-pointer-bottom-left-corner
12)
181 (defconst x-pointer-bottom-right-corner
14)
182 (defconst x-pointer-bottom-side
16)
183 (defconst x-pointer-bottom-tee
18)
184 (defconst x-pointer-box-spiral
20)
185 (defconst x-pointer-center-ptr
22)
186 (defconst x-pointer-circle
24)
187 (defconst x-pointer-clock
26)
188 (defconst x-pointer-coffee-mug
28)
189 (defconst x-pointer-cross
30)
190 (defconst x-pointer-cross-reverse
32)
191 (defconst x-pointer-crosshair
34)
192 (defconst x-pointer-diamond-cross
36)
193 (defconst x-pointer-dot
38)
194 (defconst x-pointer-dotbox
40)
195 (defconst x-pointer-double-arrow
42)
196 (defconst x-pointer-draft-large
44)
197 (defconst x-pointer-draft-small
46)
198 (defconst x-pointer-draped-box
48)
199 (defconst x-pointer-exchange
50)
200 (defconst x-pointer-fleur
52)
201 (defconst x-pointer-gobbler
54)
202 (defconst x-pointer-gumby
56)
203 (defconst x-pointer-hand1
58)
204 (defconst x-pointer-hand2
60)
205 (defconst x-pointer-heart
62)
206 (defconst x-pointer-icon
64)
207 (defconst x-pointer-iron-cross
66)
208 (defconst x-pointer-left-ptr
68)
209 (defconst x-pointer-left-side
70)
210 (defconst x-pointer-left-tee
72)
211 (defconst x-pointer-leftbutton
74)
212 (defconst x-pointer-ll-angle
76)
213 (defconst x-pointer-lr-angle
78)
214 (defconst x-pointer-man
80)
215 (defconst x-pointer-middlebutton
82)
216 (defconst x-pointer-mouse
84)
217 (defconst x-pointer-pencil
86)
218 (defconst x-pointer-pirate
88)
219 (defconst x-pointer-plus
90)
220 (defconst x-pointer-question-arrow
92)
221 (defconst x-pointer-right-ptr
94)
222 (defconst x-pointer-right-side
96)
223 (defconst x-pointer-right-tee
98)
224 (defconst x-pointer-rightbutton
100)
225 (defconst x-pointer-rtl-logo
102)
226 (defconst x-pointer-sailboat
104)
227 (defconst x-pointer-sb-down-arrow
106)
228 (defconst x-pointer-sb-h-double-arrow
108)
229 (defconst x-pointer-sb-left-arrow
110)
230 (defconst x-pointer-sb-right-arrow
112)
231 (defconst x-pointer-sb-up-arrow
114)
232 (defconst x-pointer-sb-v-double-arrow
116)
233 (defconst x-pointer-shuttle
118)
234 (defconst x-pointer-sizing
120)
235 (defconst x-pointer-spider
122)
236 (defconst x-pointer-spraycan
124)
237 (defconst x-pointer-star
126)
238 (defconst x-pointer-target
128)
239 (defconst x-pointer-tcross
130)
240 (defconst x-pointer-top-left-arrow
132)
241 (defconst x-pointer-top-left-corner
134)
242 (defconst x-pointer-top-right-corner
136)
243 (defconst x-pointer-top-side
138)
244 (defconst x-pointer-top-tee
140)
245 (defconst x-pointer-trek
142)
246 (defconst x-pointer-ul-angle
144)
247 (defconst x-pointer-umbrella
146)
248 (defconst x-pointer-ur-angle
148)
249 (defconst x-pointer-watch
150)
250 (defconst x-pointer-xterm
152)
251 (defconst x-pointer-invisible
255)
256 (defun vendor-specific-keysyms (vendor)
257 "Return the appropriate value of `system-key-alist' for VENDOR.
258 VENDOR is a string containing the name of the X Server's vendor,
259 as returned by `x-server-vendor'."
260 (cond ((or (string-equal vendor
"Hewlett-Packard Incorporated")
261 (string-equal vendor
"Hewlett-Packard Company"))
262 '(( 168 . mute-acute
)
264 ( 170 . mute-asciicircum
)
265 ( 171 . mute-diaeresis
)
266 ( 172 . mute-asciitilde
)
280 (65397 . kp-backtab
)))
281 ;; Fixme: What about non-X11/NeWS sun server?
282 ((or (string-equal vendor
"X11/NeWS - Sun Microsystems Inc.")
283 (string-equal vendor
"X Consortium"))
287 ;; These are for Sun under X11R6
295 ;; This is used by DEC's X server.
296 '((65280 . remove
)))))
301 (puthash i i x-keysym-table
)
304 ;; Table from Kuhn's proposed additions to the `KEYSYM Encoding'
305 ;; appendix to the X protocol definition.
366 (#x1ff . ?\e,B\x7f\e(B)
426 ;; Kana: Fixme: needs conversion to Japanese charset -- seems
427 ;; to require jisx0213, for which the Unicode translation
430 (#x4a1 . ?
\e$A
!#\e(B)
431 (#x4a2 . ?\
\e$A
!8\e(B)
432 (#x4a3 . ?\
\e$A
!9\e(B)
433 (#x4a4 . ?
\e$A
!"\e(B)
434 (#x4a5 . ?\e$A!$\e(B)
435 (#x4a6 . ?\e$A%r\e(B)
436 (#x4a7 . ?\e$A%!\e(B)
437 (#x4a8 . ?\e$A%#\e(B)
438 (#x4a9 . ?\e$A%%\e(B)
439 (#x4aa . ?\e$A%'\e(B)
440 (#x4ab . ?\e$A%)\e(B)
441 (#x4ac . ?\e$A%c\e(B)
442 (#x4ad . ?\e$A%e\e(B)
443 (#x4ae . ?\e$A%g\e(B)
444 (#x4af . ?\e$A%C\e(B)
445 (#x4b0 . ?\e$B!<\e(B)
446 (#x4b1 . ?\e$A%"\e(B)
447 (#x4b2 . ?
\e$A%$
\e(B)
448 (#x4b3 . ?
\e$A%
&\e(B)
449 (#x4b4 . ?
\e$A%
(\e(B)
450 (#x4b5 . ?
\e$A%
*\e(B)
451 (#x4b6 . ?
\e$A%
+\e(B)
452 (#x4b7 . ?
\e$A%-
\e(B)
453 (#x4b8 . ?
\e$A%
/\e(B)
454 (#x4b9 . ?
\e$A%
1\e(B)
455 (#x4ba . ?
\e$A%
3\e(B)
456 (#x4bb . ?
\e$A%
5\e(B)
457 (#x4bc . ?
\e$A%
7\e(B)
458 (#x4bd . ?
\e$A%
9\e(B)
459 (#x4be . ?
\e$A%
;\e(B)
460 (#x4bf . ?
\e$A%
=\e(B)
461 (#x4c0 . ?
\e$A%?
\e(B)
462 (#x4c1 . ?
\e$A%A
\e(B)
463 (#x4c2 . ?
\e$A%D
\e(B)
464 (#x4c3 . ?
\e$A%F
\e(B)
465 (#x4c4 . ?
\e$A%H
\e(B)
466 (#x4c5 . ?
\e$A%J
\e(B)
467 (#x4c6 . ?
\e$A%K
\e(B)
468 (#x4c7 . ?
\e$A%L
\e(B)
469 (#x4c8 . ?
\e$A%M
\e(B)
470 (#x4c9 . ?
\e$A%N
\e(B)
471 (#x4ca . ?
\e$A%O
\e(B)
472 (#x4cb . ?
\e$A%R
\e(B)
473 (#x4cc . ?
\e$A%U
\e(B)
474 (#x4cd . ?
\e$A%X
\e(B)
475 (#x4ce . ?
\e$A%
[\e(B)
476 (#x4cf . ?
\e$A%^
\e(B)
477 (#x4d0 . ?
\e$A%_
\e(B)
478 (#x4d1 . ?
\e$A%
`\e(B)
479 (#x4d2 . ?
\e$A%a
\e(B)
480 (#x4d3 . ?
\e$A%b
\e(B)
481 (#x4d4 . ?
\e$A%d
\e(B)
482 (#x4d5 . ?
\e$A%f
\e(B)
483 (#x4d6 . ?
\e$A%h
\e(B)
484 (#x4d7 . ?
\e$A%i
\e(B)
485 (#x4d8 . ?
\e$A%j
\e(B)
486 (#x4d9 . ?
\e$A%k
\e(B)
487 (#x4da . ?
\e$A%l
\e(B)
488 (#x4db . ?
\e$A%m
\e(B)
489 (#x4dc . ?
\e$A%o
\e(B)
490 (#x4dd . ?
\e$A%s
\e(B)
491 (#x4de . ?
\e$B
!+\e(B)
492 (#x4df . ?
\e$B
!,\e(B)
543 (#x680 . ?
\e$
,1)R
\e(B)
544 (#x681 . ?
\e$
,1)V
\e(B)
545 (#x682 . ?
\e$
,1)Z
\e(B)
546 (#x683 . ?
\e$
,1)\
\e(B)
547 (#x684 . ?
\e$
,1)b
\e(B)
548 (#x685 . ?
\e$
,1)n
\e(B)
549 (#x686 . ?
\e$
,1)p
\e(B)
550 (#x687 . ?
\e$
,1)r
\e(B)
551 (#x688 . ?
\e$
,1)v
\e(B)
552 (#x689 . ?
\e$
,1)x
\e(B)
553 (#x68a . ?
\e$
,1)z
\e(B)
554 (#x68c . ?
\e$
,1*8\e(B)
555 (#x68d . ?
\e$
,1*B
\e(B)
556 (#x68e . ?
\e$
,1*H
\e(B)
557 (#x68f . ?
\e$
,1*N
\e(B)
558 (#x690 . ?
\e$
,1)S
\e(B)
559 (#x691 . ?
\e$
,1)W
\e(B)
560 (#x692 . ?
\e$
,1)[\e(B)
561 (#x693 . ?
\e$
,1)]\e(B)
562 (#x694 . ?
\e$
,1)c
\e(B)
563 (#x695 . ?
\e$
,1)o
\e(B)
564 (#x696 . ?
\e$
,1)q
\e(B)
565 (#x697 . ?
\e$
,1)s
\e(B)
566 (#x698 . ?
\e$
,1)w
\e(B)
567 (#x699 . ?
\e$
,1)y
\e(B)
568 (#x69a . ?
\e$
,1){\e(B)
569 (#x69c . ?
\e$
,1*9\e(B)
570 (#x69d . ?
\e$
,1*C
\e(B)
571 (#x69e . ?
\e$
,1*I
\e(B)
572 (#x69f . ?
\e$
,1*O
\e(B)
586 (#x6af . ?
\e,L
\x7f\e(B)
739 (#x8a1 . ?\e$,1|W\e(B)
740 (#x8a2 . ?\e$A)0\e(B)
741 (#x8a3 . ?\e$A)$\e(B)
742 (#x8a4 . ?\e$,1{ \e(B)
743 (#x8a5 . ?\e$,1{!\e(B)
744 (#x8a6 . ?\e$A)&\e(B)
745 (#x8a7 . ?\e$,1|A\e(B)
746 (#x8a8 . ?\e$,1|C\e(B)
747 (#x8a9 . ?\e$,1|D\e(B)
748 (#x8aa . ?\e$,1|F\e(B)
749 (#x8ab . ?\e$,1|;\e(B)
750 (#x8ac . ?\e$,1|=\e(B)
751 (#x8ad . ?\e$,1|>\e(B)
752 (#x8ae . ?\e$,1|@\e(B)
753 (#x8af . ?\e$,1|H\e(B)
754 (#x8b0 . ?\e$,1|L\e(B)
755 (#x8bc . ?\e$A!\\e(B)
756 (#x8bd . ?\e$A!Y\e(B)
757 (#x8be . ?\e$A!]\e(B)
758 (#x8bf . ?\e$A!R\e(B)
759 (#x8c0 . ?\e$A!`\e(B)
760 (#x8c1 . ?\e$A!X\e(B)
761 (#x8c2 . ?\e$A!^\e(B)
762 (#x8c5 . ?\e$B"`\e(B)
763 (#x8c8 . ?
\e$
(G"D\e(B)
764 (#x8c9 . ?\e$(O"l
\e(B)
765 (#x8cd . ?
\e$B
"N\e(B)
766 (#x8ce . ?\e$B"M
\e(B)
767 (#x8cf . ?
\e$A
!T
\e(B)
768 (#x8d6 . ?
\e$A
!L
\e(B)
769 (#x8da . ?
\e$B
">\e(B)
770 (#x8db . ?\e$B"?
\e(B)
771 (#x8dc . ?
\e$A
!I
\e(B)
772 (#x8dd . ?
\e$A
!H
\e(B)
773 (#x8de . ?
\e$A
!D
\e(B)
774 (#x8df . ?
\e$A
!E
\e(B)
775 (#x8ef . ?
\e$B
"_\e(B)
776 (#x8f6 . ?\e$,1!R\e(B)
777 (#x8fb . ?\e$A!{\e(B)
778 (#x8fc . ?\e$A!|\e(B)
779 (#x8fd . ?\e$A!z\e(B)
780 (#x8fe . ?\e$A!}\e(B)
782 (#x9e0 . ?\e$A!t\e(B)
783 (#x9e1 . ?\e$(C"F
\e(B)
784 (#x9e2 . ?
\e$
(GB*\e(B)
785 (#x9e3 . ?
\e$
(GB-\e(B)
786 (#x9e4 . ?
\e$
(GB.
\e(B)
787 (#x9e5 . ?
\e$
(GB+\e(B)
788 (#x9e8 . ?
\e$
,1}d
\e(B)
789 (#x9e9 . ?
\e$
(GB,\e(B)
790 (#x9ea . ?
\e$A
)<\e(B)
791 (#x9eb . ?
\e$A
)4\e(B)
792 (#x9ec . ?
\e$A
)0\e(B)
793 (#x9ed . ?
\e$A
)8\e(B)
794 (#x9ee . ?
\e$A
)`\e(B)
795 (#x9ef . ?
\e$
,1|Z
\e(B)
796 (#x9f0 . ?
\e$
,1|
[\e(B)
797 (#x9f1 . ?
\e$A
)$
\e(B)
798 (#x9f2 . ?
\e$
,1|\
\e(B)
799 (#x9f3 . ?
\e$
,1|
]\e(B)
800 (#x9f4 . ?
\e$A
)@\e(B)
801 (#x9f5 . ?
\e$A
)H
\e(B)
802 (#x9f6 . ?
\e$A
)X
\e(B)
803 (#x9f7 . ?
\e$A
)P
\e(B)
804 (#x9f8 . ?
\e$A
)&\e(B)
806 (#xaa1 . ?
\e$
,1rc
\e(B)
807 (#xaa2 . ?
\e$
,1rb
\e(B)
808 (#xaa3 . ?
\e$
,1rd
\e(B)
809 (#xaa4 . ?
\e$
,1re
\e(B)
810 (#xaa5 . ?
\e$
,1rg
\e(B)
811 (#xaa6 . ?
\e$
,1rh
\e(B)
812 (#xaa7 . ?
\e$
,1ri
\e(B)
813 (#xaa8 . ?
\e$
,1rj
\e(B)
814 (#xaa9 . ?
\e$
(G!7\e(B)
815 (#xaaa . ?
\e$
(G!9\e(B)
816 (#xaae . ?
\e$A
!-
\e(B)
817 (#xaaf . ?
\e$
(G!-
\e(B)
818 (#xab0 . ?
\e$
(O'x
\e(B)
819 (#xab1 . ?
\e$
(O'y
\e(B)
820 (#xab2 . ?
\e$
(O'z
\e(B)
821 (#xab3 . ?
\e$
,1v6
\e(B)
822 (#xab4 . ?
\e$
,1v7
\e(B)
823 (#xab5 . ?
\e$
,1v8
\e(B)
824 (#xab6 . ?
\e$
,1v9
\e(B)
825 (#xab7 . ?
\e$
,1v
:\e(B)
826 (#xab8 . ?
\e$
(G""\e(B)
827 (#xabb . ?
\e$
,1rr
\e(B)
828 (#xabc . ?
\e$
,1{)\e(B)
829 (#xabe . ?
\e$
,1{*\e(B)
830 (#xac3 . ?
\e$
(C({\e(B)
831 (#xac4 . ?
\e$
(C(|
\e(B)
832 (#xac5 . ?
\e$
(C(}\e(B)
833 (#xac6 . ?
\e$
(C(~
\e(B)
834 (#xac9 . ?
\e$
(D"o\e(B)
835 (#xaca . ?\e$,2"s
\e(B)
836 (#xacc . ?
\e$
(O##\e(B)
837 (#xacd . ?
\e$
(O#!\e(B)
838 (#xace . ?
\e$A
!p
\e(B)
839 (#xacf . ?
\e$
,2!o
\e(B)
844 (#xad4 . ?\e$,1u^\e(B)
845 (#xad6 . ?\e$A!d\e(B)
846 (#xad7 . ?\e$A!e\e(B)
847 (#xad9 . ?\e$,2%]\e(B)
848 (#xadb . ?\e$,2!l\e(B)
849 (#xadc . ?\e$(O#$\e(B)
850 (#xadd . ?\e$(O#"\e(B)
851 (#xade . ?
\e$A
!q
\e(B)
852 (#xadf . ?
\e$
,2!n
\e(B)
853 (#xae0 . ?
\e$
(O#?
\e(B)
854 (#xae1 . ?
\e$
,2!k
\e(B)
855 (#xae2 . ?
\e$
,2!m
\e(B)
856 (#xae3 . ?
\e$A
!w
\e(B)
857 (#xae4 . ?
\e$
(G!}\e(B)
858 (#xae5 . ?
\e$A
!n
\e(B)
859 (#xae6 . ?
\e$
(O#@\e(B)
860 (#xae7 . ?
\e$
,2!j
\e(B)
861 (#xae8 . ?
\e$A
!x
\e(B)
862 (#xae9 . ?
\e$
(G!~
\e(B)
863 (#xaea . ?
\e$
(C"P\e(B)
864 (#xaeb . ?\e$(O-~\e(B)
865 (#xaec . ?\e$(O&@\e(B)
866 (#xaed . ?\e$(O&<\e(B)
867 (#xaee . ?\e$(O&>\e(B)
868 (#xaf0 . ?\e$,2%`\e(B)
869 (#xaf1 . ?\e$B"w
\e(B)
870 (#xaf2 . ?
\e$B
"x\e(B)
871 (#xaf3 . ?\e$(O'{\e(B)
872 (#xaf4 . ?\e$,2%W\e(B)
873 (#xaf5 . ?\e$B"t
\e(B)
874 (#xaf6 . ?
\e$B
"u\e(B)
875 (#xaf7 . ?\e$A!a\e(B)
876 (#xaf8 . ?\e$A!b\e(B)
877 (#xaf9 . ?\e$(O&g\e(B)
878 (#xafa . ?\e$,1zu\e(B)
879 (#xafb . ?\e$,1uW\e(B)
880 (#xafc . ?\e$,1s8\e(B)
881 (#xafd . ?\e$,1rz\e(B)
886 (#xba8 . ?\e$A!E\e(B)
887 (#xba9 . ?\e$A!D\e(B)
889 (#xbc2 . ?\e$A!M\e(B)
890 (#xbc3 . ?\e$A!I\e(B)
891 (#xbc4 . ?\e$,1zj\e(B)
893 (#xbca . ?\e$,1x8\e(B)
894 (#xbcc . ?\e$,1|5\e(B)
895 (#xbce . ?\e$,1yd\e(B)
896 (#xbcf . ?\e$A!p\e(B)
897 (#xbd3 . ?\e$,1zh\e(B)
898 (#xbd6 . ?\e$A!H\e(B)
899 (#xbd8 . ?\e$B"?
\e(B)
900 (#xbda . ?
\e$B
">\e(B)
901 (#xbdc . ?\e$,1yb\e(B)
902 (#xbfc . ?\e$,1yc\e(B)
1000 (#xde8 . ?
\e,Th
\e(B)
1001 (#xde9 . ?
\e,Ti
\e(B)
1002 (#xdea . ?
\e,Tj
\e(B)
1003 (#xdeb . ?
\e,Tk
\e(B)
1004 (#xdec . ?
\e,Tl
\e(B)
1005 (#xded . ?
\e,Tm
\e(B)
1006 (#xdf0 . ?
\e,Tp
\e(B)
1007 (#xdf1 . ?
\e,Tq
\e(B)
1008 (#xdf2 . ?
\e,Tr
\e(B)
1009 (#xdf3 . ?
\e,Ts
\e(B)
1010 (#xdf4 . ?
\e,Tt
\e(B)
1011 (#xdf5 . ?
\e,Tu
\e(B)
1012 (#xdf6 . ?
\e,Tv
\e(B)
1013 (#xdf7 . ?
\e,Tw
\e(B)
1014 (#xdf8 . ?
\e,Tx
\e(B)
1015 (#xdf9 . ?
\e,Ty
\e(B)
1017 (#xea1 . ?
\e$
(C$
!\e(B)
1018 (#xea2 . ?
\e$
(C$
"\e(B)
1019 (#xea3 . ?\e$(C$#\e(B)
1020 (#xea4 . ?\e$(C$$\e(B)
1021 (#xea5 . ?\e$(C$%\e(B)
1022 (#xea6 . ?\e$(C$&\e(B)
1023 (#xea7 . ?\e$(C$'\e(B)
1024 (#xea8 . ?\e$(C$(\e(B)
1025 (#xea9 . ?\e$(C$)\e(B)
1026 (#xeaa . ?\e$(C$*\e(B)
1027 (#xeab . ?\e$(C$+\e(B)
1028 (#xeac . ?\e$(C$,\e(B)
1029 (#xead . ?\e$(C$-\e(B)
1030 (#xeae . ?\e$(C$.\e(B)
1031 (#xeaf . ?\e$(C$/\e(B)
1032 (#xeb0 . ?\e$(C$0\e(B)
1033 (#xeb1 . ?\e$(C$1\e(B)
1034 (#xeb2 . ?\e$(C$2\e(B)
1035 (#xeb3 . ?\e$(C$3\e(B)
1036 (#xeb4 . ?\e$(C$4\e(B)
1037 (#xeb5 . ?\e$(C$5\e(B)
1038 (#xeb6 . ?\e$(C$6\e(B)
1039 (#xeb7 . ?\e$(C$7\e(B)
1040 (#xeb8 . ?\e$(C$8\e(B)
1041 (#xeb9 . ?\e$(C$9\e(B)
1042 (#xeba . ?\e$(C$:\e(B)
1043 (#xebb . ?\e$(C$;\e(B)
1044 (#xebc . ?\e$(C$<\e(B)
1045 (#xebd . ?\e$(C$=\e(B)
1046 (#xebe . ?\e$(C$>\e(B)
1047 (#xebf . ?\e$(C$?\e(B)
1048 (#xec0 . ?\e$(C$@\e(B)
1049 (#xec1 . ?\e$(C$A\e(B)
1050 (#xec2 . ?\e$(C$B\e(B)
1051 (#xec3 . ?\e$(C$C\e(B)
1052 (#xec4 . ?\e$(C$D\e(B)
1053 (#xec5 . ?\e$(C$E\e(B)
1054 (#xec6 . ?\e$(C$F\e(B)
1055 (#xec7 . ?\e$(C$G\e(B)
1056 (#xec8 . ?\e$(C$H\e(B)
1057 (#xec9 . ?\e$(C$I\e(B)
1058 (#xeca . ?\e$(C$J\e(B)
1059 (#xecb . ?\e$(C$K\e(B)
1060 (#xecc . ?\e$(C$L\e(B)
1061 (#xecd . ?\e$(C$M\e(B)
1062 (#xece . ?\e$(C$N\e(B)
1063 (#xecf . ?\e$(C$O\e(B)
1064 (#xed0 . ?\e$(C$P\e(B)
1065 (#xed1 . ?\e$(C$Q\e(B)
1066 (#xed2 . ?\e$(C$R\e(B)
1067 (#xed3 . ?\e$(C$S\e(B)
1068 (#xed4 . ?\e$,1LH\e(B)
1069 (#xed5 . ?\e$,1LI\e(B)
1070 (#xed6 . ?\e$,1LJ\e(B)
1071 (#xed7 . ?\e$,1LK\e(B)
1072 (#xed8 . ?\e$,1LL\e(B)
1073 (#xed9 . ?\e$,1LM\e(B)
1074 (#xeda . ?\e$,1LN\e(B)
1075 (#xedb . ?\e$,1LO\e(B)
1076 (#xedc . ?\e$,1LP\e(B)
1077 (#xedd . ?\e$,1LQ\e(B)
1078 (#xede . ?\e$,1LR\e(B)
1079 (#xedf . ?\e$,1LS\e(B)
1080 (#xee0 . ?\e$,1LT\e(B)
1081 (#xee1 . ?\e$,1LU\e(B)
1082 (#xee2 . ?\e$,1LV\e(B)
1083 (#xee3 . ?\e$,1LW\e(B)
1084 (#xee4 . ?\e$,1LX\e(B)
1085 (#xee5 . ?\e$,1LY\e(B)
1086 (#xee6 . ?\e$,1LZ\e(B)
1087 (#xee7 . ?\e$,1L[\e(B)
1088 (#xee8 . ?\e$,1L\\e(B)
1089 (#xee9 . ?\e$,1L]\e(B)
1090 (#xeea . ?\e$,1L^\e(B)
1091 (#xeeb . ?\e$,1L_\e(B)
1092 (#xeec . ?\e$,1L`\e(B)
1093 (#xeed . ?\e$,1La\e(B)
1094 (#xeee . ?\e$,1Lb\e(B)
1095 (#xeef . ?\e$(C$]\e(B)
1096 (#xef0 . ?\e$(C$a\e(B)
1097 (#xef1 . ?\e$(C$h\e(B)
1098 (#xef2 . ?\e$(C$o\e(B)
1099 (#xef3 . ?\e$(C$q\e(B)
1100 (#xef4 . ?\e$(C$t\e(B)
1101 (#xef5 . ?\e$(C$v\e(B)
1102 (#xef6 . ?\e$(C$}\e(B)
1103 (#xef7 . ?\e$(C$~\e(B)
1104 (#xef8 . ?\e$,1M+\e(B)
1105 (#xef9 . ?\e$,1M0\e(B)
1106 (#xefa . ?\e$,1M9\e(B)
1107 (#xeff . ?\e$,1tI\e(B)
1113 (#x13bc . ?\e,b<\e(B)
1114 (#x13bd . ?\e,b=\e(B)
1115 (#x13be . ?\e,_/\e(B)
1117 (#x20a0 . ?\e$,1t@\e(B)
1118 (#x20a1 . ?\e$,1tA\e(B)
1119 (#x20a2 . ?\e$,1tB\e(B)
1120 (#x20a3 . ?\e$,1tC\e(B)
1121 (#x20a4 . ?\e$,1tD\e(B)
1122 (#x20a5 . ?\e$,1tE\e(B)
1123 (#x20a6 . ?\e$,1tF\e(B)
1124 (#x20a7 . ?\e$,1tG\e(B)
1125 (#x20a8 . ?\e$,1tH\e(B)
1126 (#x20aa . ?\e$,1tJ\e(B)
1127 (#x20ab . ?\e$,1tK\e(B)
1128 (#x20ac . ?\e,b$\e(B)))
1129 (puthash (car pair) (cdr pair) x-keysym-table))
1131 ;; The following keysym codes for graphics are listed in the document
1132 ;; as not having unicodes available:
1134 ;; #x08b1 TOP LEFT SUMMATION Technical
1135 ;; #x08b2 BOTTOM LEFT SUMMATION Technical
1136 ;; #x08b3 TOP VERTICAL SUMMATION CONNECTOR Technical
1137 ;; #x08b4 BOTTOM VERTICAL SUMMATION CONNECTOR Technical
1138 ;; #x08b5 TOP RIGHT SUMMATION Technical
1139 ;; #x08b6 BOTTOM RIGHT SUMMATION Technical
1140 ;; #x08b7 RIGHT MIDDLE SUMMATION Technical
1141 ;; #x0aac SIGNIFICANT BLANK SYMBOL Publish
1142 ;; #x0abd DECIMAL POINT Publish
1143 ;; #x0abf MARKER Publish
1144 ;; #x0acb TRADEMARK SIGN IN CIRCLE Publish
1145 ;; #x0ada HEXAGRAM Publish
1146 ;; #x0aff CURSOR Publish
1147 ;; #x0dde THAI MAIHANAKAT Thai
1152 ;; We keep track of the last text selected here, so we can check the
1153 ;; current selection against it, and avoid passing back our own text
1154 ;; from x-selection-value. We track both
1155 ;; separately in case another X application only sets one of them
1156 ;; we aren't fooled by the PRIMARY or CLIPBOARD selection staying the same.
1157 (defvar x-last-selected-text-clipboard nil
1158 "The value of the CLIPBOARD X selection last time we selected or
1160 (defvar x-last-selected-text-primary nil
1161 "The value of the PRIMARY X selection last time we selected or
1164 (defcustom x-select-enable-primary nil
1165 "Non-nil means cutting and pasting uses the primary selection.
"
1170 (defcustom x-select-request-type nil
1171 "Data type request for X selection.
1172 The value is one of the following data types
, a list of them
, or nil
:
1173 `COMPOUND_TEXT
', `UTF8_STRING
', `STRING
', `TEXT
'
1175 If the value is one of the above symbols
, try only the specified type.
1177 If the value is a list of them
, try each of them in the specified
1178 order until succeed.
1180 The value nil is the same as the list
(UTF8_STRING COMPOUND_TEXT STRING
).
"
1181 :type '(choice (const :tag "Default
" nil)
1182 (const COMPOUND_TEXT)
1186 (set :tag "List of values
"
1187 (const COMPOUND_TEXT)
1193 ;; Get a selection value of type TYPE by calling x-get-selection with
1194 ;; an appropriate DATA-TYPE argument decided by `x-select-request-type'.
1195 ;; The return value is already decoded. If x-get-selection causes an
1196 ;; error, this function return nil.
1198 (defun x-selection-value-internal (type)
1199 (let ((request-type (or x-select-request-type
1200 '(UTF8_STRING COMPOUND_TEXT STRING)))
1202 (if (consp request-type)
1203 (while (and request-type (not text))
1205 (setq text (x-get-selection type (car request-type)))
1207 (setq request-type (cdr request-type)))
1209 (setq text (x-get-selection type request-type))
1212 (remove-text-properties 0 (length text) '(foreign-selection nil) text))
1215 ;; Return the value of the current X selection.
1216 ;; Consult the selection. Treat empty strings as if they were unset.
1217 ;; If this function is called twice and finds the same text,
1218 ;; it returns nil the second time. This is so that a single
1219 ;; selection won't be added to the kill ring over and over.
1220 (defun x-selection-value ()
1221 ;; With multi-tty, this function may be called from a tty frame.
1222 (when (eq (framep (selected-frame)) 'x)
1223 (let (clip-text primary-text)
1224 (when x-select-enable-clipboard
1225 (setq clip-text (x-selection-value-internal 'CLIPBOARD))
1226 (if (string= clip-text "") (setq clip-text nil))
1228 ;; Check the CLIPBOARD selection for 'newness', is it different
1229 ;; from what we remembered them to be last time we did a
1230 ;; cut/paste operation.
1232 (cond ;; check clipboard
1233 ((or (not clip-text) (string= clip-text ""))
1234 (setq x-last-selected-text-clipboard nil))
1235 ((eq clip-text x-last-selected-text-clipboard) nil)
1236 ((string= clip-text x-last-selected-text-clipboard)
1237 ;; Record the newer string,
1238 ;; so subsequent calls can use the `eq' test.
1239 (setq x-last-selected-text-clipboard clip-text)
1241 (t (setq x-last-selected-text-clipboard clip-text)))))
1243 (when x-select-enable-primary
1244 (setq primary-text (x-selection-value-internal 'PRIMARY))
1245 ;; Check the PRIMARY selection for 'newness', is it different
1246 ;; from what we remembered them to be last time we did a
1247 ;; cut/paste operation.
1249 (cond ;; check primary selection
1250 ((or (not primary-text) (string= primary-text ""))
1251 (setq x-last-selected-text-primary nil))
1252 ((eq primary-text x-last-selected-text-primary) nil)
1253 ((string= primary-text x-last-selected-text-primary)
1254 ;; Record the newer string,
1255 ;; so subsequent calls can use the `eq' test.
1256 (setq x-last-selected-text-primary primary-text)
1259 (setq x-last-selected-text-primary primary-text)))))
1261 ;; As we have done one selection, clear this now.
1262 (setq next-selection-coding-system nil)
1264 ;; At this point we have recorded the current values for the
1265 ;; selection from clipboard (if we are supposed to) and primary.
1266 ;; So return the first one that has changed
1267 ;; (which is the first non-null one).
1269 ;; NOTE: There will be cases where more than one of these has
1270 ;; changed and the new values differ. This indicates that
1271 ;; something like the following has happened since the last time
1272 ;; we looked at the selections: Application X set all the
1273 ;; selections, then Application Y set only one of them.
1274 ;; In this case since we don't have
1275 ;; timestamps there is no way to know what the 'correct' value to
1276 ;; return is. The nice thing to do would be to tell the user we
1277 ;; saw multiple possible selections and ask the user which was the
1279 (or clip-text primary-text)
1282 (define-obsolete-function-alias 'x-cut-buffer-or-selection-value
1283 'x-selection-value "24.1")
1285 ;; Arrange for the kill and yank functions to set and check the clipboard.
1286 (setq interprogram-cut-function 'x-select-text)
1287 (setq interprogram-paste-function 'x-selection-value)
1289 ;; Make paste from other applications use the decoding in x-select-request-type
1290 ;; and not just STRING.
1291 (defun x-get-selection-value ()
1292 "Get the current value of the PRIMARY selection.
1293 Request data types in the order specified by
`x-select-request-type
'.
"
1294 (x-selection-value-internal 'PRIMARY))
1296 (defun x-clipboard-yank ()
1297 "Insert the clipboard contents
, or the last stretch of killed text.
"
1299 (let ((clipboard-text (x-selection-value-internal 'CLIPBOARD))
1300 (x-select-enable-clipboard t))
1301 (if (and clipboard-text (> (length clipboard-text) 0))
1302 (kill-new clipboard-text))
1305 (declare-function accelerate-menu "xmenu.c
" (&optional frame) t)
1307 (defun x-menu-bar-open (&optional frame)
1308 "Open the menu bar if
`menu-bar-mode
' is on
, otherwise call
`tmm-menubar
'.
"
1310 (if (and menu-bar-mode
1311 (fboundp 'accelerate-menu))
1312 (accelerate-menu frame)
1316 ;;; Window system initialization.
1318 (defun x-win-suspend-error ()
1319 ;; Don't allow suspending if any of the frames are X frames.
1320 (if (memq 'x (mapcar 'window-system (frame-list)))
1321 (error "Cannot suspend Emacs while running under X
")))
1323 (defvar x-initialized nil
1324 "Non-nil if the X window system has been initialized.
")
1326 (declare-function x-open-connection "xfns.c
"
1327 (display &optional xrm-string must-succeed))
1328 (declare-function x-server-max-request-size "xfns.c
" (&optional terminal))
1329 (declare-function x-get-resource "frame.c
"
1330 (attribute class &optional component subclass))
1331 (declare-function x-parse-geometry "frame.c
" (string))
1332 (defvar x-resource-name)
1333 (defvar x-display-name)
1334 (defvar x-command-line-resources)
1336 (defun x-initialize-window-system ()
1337 "Initialize Emacs for X frames and open the first connection to an X server.
"
1338 ;; Make sure we have a valid resource name.
1339 (or (stringp x-resource-name)
1341 (setq x-resource-name (invocation-name))
1343 ;; Change any . or * characters in x-resource-name to hyphens,
1344 ;; so as not to choke when we use it in X resource queries.
1345 (while (setq i (string-match "[.
*]" x-resource-name))
1346 (aset x-resource-name i ?-))))
1348 (x-open-connection (or x-display-name
1349 (setq x-display-name (or (getenv "DISPLAY
" (selected-frame))
1350 (getenv "DISPLAY
"))))
1351 x-command-line-resources
1352 ;; Exit Emacs with fatal error if this fails and we
1353 ;; are the initial display.
1354 (eq initial-window-system 'x))
1356 ;; Create the default fontset.
1357 (create-default-fontset)
1359 ;; Create the standard fontset.
1361 (create-fontset-from-fontset-spec standard-fontset-spec t)
1362 (error (display-warning
1364 (format "Creation of the standard fontset failed
: %s
" err)
1367 ;; Create fontset specified in X resources "Fontset-N
" (N is 0, 1, ...).
1368 (create-fontset-from-x-resource)
1370 ;; Set scroll bar mode to right if set by X resources. Default is left.
1371 (if (equal (x-get-resource "verticalScrollBars
" "ScrollBars
") "right
")
1372 (customize-set-variable 'scroll-bar-mode 'right))
1374 ;; Apply a geometry resource to the initial frame. Put it at the end
1375 ;; of the alist, so that anything specified on the command line takes
1377 (let* ((res-geometry (x-get-resource "geometry
" "Geometry
"))
1381 (setq parsed (x-parse-geometry res-geometry))
1382 ;; If the resource specifies a position,
1383 ;; call the position and size "user-specified
".
1384 (if (or (assq 'top parsed) (assq 'left parsed))
1385 (setq parsed (cons '(user-position . t)
1386 (cons '(user-size . t) parsed))))
1387 ;; All geometry parms apply to the initial frame.
1388 (setq initial-frame-alist (append initial-frame-alist parsed))
1389 ;; The size parms apply to all frames. Don't set it if there are
1390 ;; sizes there already (from command line).
1391 (if (and (assq 'height parsed)
1392 (not (assq 'height default-frame-alist)))
1393 (setq default-frame-alist
1394 (cons (cons 'height (cdr (assq 'height parsed)))
1395 default-frame-alist)))
1396 (if (and (assq 'width parsed)
1397 (not (assq 'width default-frame-alist)))
1398 (setq default-frame-alist
1399 (cons (cons 'width (cdr (assq 'width parsed)))
1400 default-frame-alist))))))
1402 ;; Check the reverseVideo resource.
1403 (let ((case-fold-search t))
1404 (let ((rv (x-get-resource "reverseVideo
" "ReverseVideo
")))
1406 (string-match "^
\\(true\\|yes
\\|on
\\)$
" rv))
1407 (setq default-frame-alist
1408 (cons '(reverse . t) default-frame-alist)))))
1410 ;; Set x-selection-timeout, measured in milliseconds.
1411 (let ((res-selection-timeout (x-get-resource "selectionTimeout
"
1412 "SelectionTimeout
")))
1413 (setq x-selection-timeout
1414 (if res-selection-timeout
1415 (string-to-number res-selection-timeout)
1418 ;; Don't let Emacs suspend under X.
1419 (add-hook 'suspend-hook 'x-win-suspend-error)
1421 ;; During initialization, we defer sending size hints to the window
1422 ;; manager, because that can induce a race condition:
1423 ;; http://lists.gnu.org/archive/html/emacs-devel/2008-10/msg00033.html
1424 ;; Send the size hints once initialization is done.
1425 (add-hook 'after-init-hook 'x-wm-set-size-hint)
1427 ;; Turn off window-splitting optimization; X is usually fast enough
1428 ;; that this is only annoying.
1429 (setq split-window-keep-point t)
1431 ;; Motif direct handling of f10 wasn't working right,
1432 ;; So temporarily we've turned it off in lwlib-Xm.c
1433 ;; and turned the Emacs f10 back on.
1434 ;; ;; Motif normally handles f10 itself, so don't try to handle it a second time.
1435 ;; (if (featurep 'motif)
1436 ;; (global-set-key [f10] 'ignore))
1438 ;; Enable CLIPBOARD copy/paste through menu bar commands.
1439 (menu-bar-enable-clipboard)
1441 ;; ;; Override Paste so it looks at CLIPBOARD first.
1442 ;; (define-key menu-bar-edit-menu [paste]
1443 ;; (append '(menu-item "Paste
" x-clipboard-yank
1444 ;; :enable (not buffer-read-only)
1445 ;; :help "Paste
(yank) text most recently cut
/copied
")
1448 (setq x-initialized t))
1450 (add-to-list 'handle-args-function-alist '(x . x-handle-args))
1451 (add-to-list 'frame-creation-function-alist '(x . x-create-frame-with-faces))
1452 (add-to-list 'window-system-initialization-alist '(x . x-initialize-window-system))
1454 ;; Initiate drag and drop
1455 (add-hook 'after-make-frame-functions 'x-dnd-init-frame)
1456 (define-key special-event-map [drag-n-drop] 'x-dnd-handle-drag-n-drop-event)
1458 (defcustom x-gtk-stock-map
1459 (mapcar (lambda (arg)
1460 (cons (purecopy (car arg)) (purecopy (cdr arg))))
1462 ("etc
/images
/new
" . "gtk-new
")
1463 ("etc
/images
/open
" . "gtk-open
")
1464 ("etc
/images
/diropen
" . "n
:system-file-manager
")
1465 ("etc
/images
/close
" . "gtk-close
")
1466 ("etc
/images
/save
" . "gtk-save
")
1467 ("etc
/images
/saveas
" . "gtk-save-as
")
1468 ("etc
/images
/undo
" . "gtk-undo
")
1469 ("etc
/images
/cut
" . "gtk-cut
")
1470 ("etc
/images
/copy
" . "gtk-copy
")
1471 ("etc
/images
/paste
" . "gtk-paste
")
1472 ("etc
/images
/search
" . "gtk-find
")
1473 ("etc
/images
/print
" . "gtk-print
")
1474 ("etc
/images
/preferences
" . "gtk-preferences
")
1475 ("etc
/images
/help
" . "gtk-help
")
1476 ("etc
/images
/left-arrow
" . "gtk-go-back
")
1477 ("etc
/images
/right-arrow
" . "gtk-go-forward
")
1478 ("etc
/images
/home
" . "gtk-home
")
1479 ("etc
/images
/jump-to
" . "gtk-jump-to
")
1480 ("etc
/images
/index
" . "gtk-index
")
1481 ("etc
/images
/search
" . "gtk-find
")
1482 ("etc
/images
/exit
" . "gtk-quit
")
1483 ("etc
/images
/cancel
" . "gtk-cancel
")
1484 ("etc
/images
/info
" . "gtk-info
")
1485 ("etc
/images
/bookmark_add
" . "n
:bookmark_add
")
1486 ;; Used in Gnus and/or MH-E:
1487 ("etc
/images
/attach
" . "gtk-attach
")
1488 ("etc
/images
/connect
" . "gtk-connect
")
1489 ("etc
/images
/contact
" . "gtk-contact
")
1490 ("etc
/images
/delete
" . "gtk-delete
")
1491 ("etc
/images
/describe
" . "gtk-properties
")
1492 ("etc
/images
/disconnect
" . "gtk-disconnect
")
1493 ;; ("etc
/images
/exit
" . "gtk-exit
")
1494 ("etc
/images
/lock-broken
" . "gtk-lock_broken
")
1495 ("etc
/images
/lock-ok
" . "gtk-lock_ok
")
1496 ("etc
/images
/lock
" . "gtk-lock
")
1497 ("etc
/images
/next-page
" . "gtk-next-page
")
1498 ("etc
/images
/refresh
" . "gtk-refresh
")
1499 ("etc
/images
/sort-ascending
" . "gtk-sort-ascending
")
1500 ("etc
/images
/sort-column-ascending
" . "gtk-sort-column-ascending
")
1501 ("etc
/images
/sort-criteria
" . "gtk-sort-criteria
")
1502 ("etc
/images
/sort-descending
" . "gtk-sort-descending
")
1503 ("etc
/images
/sort-row-ascending
" . "gtk-sort-row-ascending
")
1504 ("images
/gnus
/toggle-subscription
" . "gtk-task-recurring
")
1505 ("images
/mail
/compose
" . "gtk-mail-compose
")
1506 ("images
/mail
/copy
" . "gtk-mail-copy
")
1507 ("images
/mail
/forward
" . "gtk-mail-forward
")
1508 ("images
/mail
/inbox
" . "gtk-inbox
")
1509 ("images
/mail
/move
" . "gtk-mail-move
")
1510 ("images
/mail
/not-spam
" . "gtk-not-spam
")
1511 ("images
/mail
/outbox
" . "gtk-outbox
")
1512 ("images
/mail
/reply-all
" . "gtk-mail-reply-to-all
")
1513 ("images
/mail
/reply
" . "gtk-mail-reply
")
1514 ("images
/mail
/save-draft
" . "gtk-mail-handling
")
1515 ("images
/mail
/send
" . "gtk-mail-send
")
1516 ("images
/mail
/spam
" . "gtk-spam
")
1517 ;; Used for GDB Graphical Interface
1518 ("images
/gud
/break
" . "gtk-no
")
1519 ("images
/gud
/recstart
" . "gtk-media-record
")
1520 ("images
/gud
/recstop
" . "gtk-media-stop
")
1521 ;; No themed versions available:
1522 ;; mail/preview (combining stock_mail and stock_zoom)
1523 ;; mail/save (combining stock_mail, stock_save and stock_convert)
1525 "How icons for tool bars are mapped to Gtk
+ stock items.
1526 Emacs must be compiled with the Gtk
+ toolkit for this to have any effect.
1527 A value that begins with n
: denotes a named icon instead of a stock icon.
"
1529 :type '(choice (repeat (choice symbol
1530 (cons (string :tag "Emacs icon
")
1531 (string :tag "Stock
/named
")))))
1534 (defcustom icon-map-list '(x-gtk-stock-map)
1535 "A list of alists that map icon file names to stock
/named icons.
1536 The alists are searched in the order they appear. The first match is used.
1537 The keys in the alists are file names without extension and with two directory
1538 components. For example
, to map
/usr
/share
/emacs
/22.1.1/etc
/images
/open.xpm
1539 to stock item gtk-open
, use
:
1541 (\"etc
/images
/open
\" .
\"gtk-open
\")
1543 Themes also have named icons. To map to one of those
, use n
: before the name
:
1545 (\"etc
/images
/diropen
\" .
\"n
:system-file-manager
\")
1547 The list elements are either the symbol name for the alist or the
1550 If you don
't want stock icons
, set the variable to nil.
"
1552 :type '(choice (const :tag "Don
't use stock icons
" nil)
1553 (repeat (choice symbol
1554 (cons (string :tag "Emacs icon
")
1555 (string :tag "Stock
/named
")))))
1558 (defconst x-gtk-stock-cache (make-hash-table :weakness t :test 'equal))
1560 (defun x-gtk-map-stock (file)
1561 "Map icon with file name FILE to a Gtk
+ stock name.
1562 This uses
`icon-map-list
' to map icon file names to stock icon names.
"
1563 (when (stringp file)
1564 (or (gethash file x-gtk-stock-cache)
1568 (let* ((file-sans (file-name-sans-extension file))
1569 (key (and (string-match "/\\([^
/]+/[^
/]+/[^
/]+$
\\)"
1571 (match-string 1 file-sans)))
1572 (icon-map icon-map-list)
1574 (while (and (null value) icon-map)
1575 (setq elem (car icon-map)
1576 value (assoc-string (or key file-sans)
1580 icon-map (cdr icon-map)))
1581 (and value (cdr value))))
1582 x-gtk-stock-cache))))
1586 ;;; x-win.el ends here