annotate lisp/gtk-init.el @ 5342:174aed57a32a

Require that NAME be an unquoted symbol, #'block, #'return-from 2011-01-22 Aidan Kehoe <kehoea@parhasard.net> * cl-macs.el (block, return-from): Require that NAME be a symbol in these macros, as always documented in the #'block docstring and as required by Common Lisp. * descr-text.el (unidata-initialize-unihan-database): Correct the use of non-symbols in #'block and #'return-from in this function.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 22 Jan 2011 17:20:19 +0000
parents e34711681f30
children 308d34e9f07d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
1 ;;; gtk-init.el --- initialization code for mswindows
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
2 ;; Copyright (C) 1990, 1993, 1994 Free Software Foundation, Inc.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
3 ;; Copyright (C) 1995 Board of Trustees, University of Illinois.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
4 ;; Copyright (C) 1995, 1996 Ben Wing.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
5
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
6 ;; Author: various
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
7 ;; Rewritten for Gtk by: William Perry
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
8
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
9 ;; This file is part of XEmacs.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
10
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
11 ;; XEmacs is free software; you can redistribute it and/or modify it
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
12 ;; under the terms of the GNU General Public License as published by
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
14 ;; any later version.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
15
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
16 ;; XEmacs is distributed in the hope that it will be useful, but
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
19 ;; General Public License for more details.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
20
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
22 ;; along with XEmacs; see the file COPYING. If not, write to the
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
23 ;; Free Software Foundation, 59 Temple Place - Suite 330,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
24 ;; Boston, MA 02111-1307, USA.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
25
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
26 (globally-declare-boundp
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
27 '(gtk-initial-argv-list gtk-initial-geometry))
506
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 502
diff changeset
28
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 502
diff changeset
29 (globally-declare-fboundp
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 502
diff changeset
30 '(gtk-keysym-on-keyboard-p))
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 487
diff changeset
31
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
32 (defvar gtk-early-lisp-options-file "~/.xemacs/gtk-options.el"
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
33 "Path where GTK-specific early options should be stored.
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
34
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
35 This allows the user to set initial geometry without using GNOME and session
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
36 management, and, since it is read before GTK is initialized, it avoids
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
37 window flicker on resizing.
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
38
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
39 It is normally not useful to change without recompiling XEmacs.")
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
40
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
41 (defvar gtk-command-switch-alist
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
42 '(
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
43 ;; GNOME Options
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
44 ("--disable-sound" . nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
45 ("--enable-sound" . nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
46 ("--espeaker" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
47
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
48 ;; GTK Options
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
49 ("--gdk-debug" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
50 ("--gdk-no-debug" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
51 ("--display" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
52 ("--sync" . nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
53 ("--no-xshm" . nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
54 ("--name" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
55 ("--class" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
56 ("--gxid_host" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
57 ("--gxid_port" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
58 ("--xim-preedit" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
59 ("--xim-status" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
60 ("--gtk-debug" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
61 ("--gtk-no-debug" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
62 ("--gtk-module" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
63
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
64 ;; Glib options
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
65 ("--g-fatal-warnings" . nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
66
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
67 ;; Session management options
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
68 ("--sm-client-id" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
69 ("--sm-config-prefix" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
70 ("--sm-disable" . t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
71 )
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
72
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
73 "An assoc list of command line args that should be in gtk-initial-argv-list.
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
74 This is necessary because GTK and GNOME consider it a fatal error if they
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
75 receive unknown command line arguments (perfectly reasonable). But this
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
76 means that if the user specifies a file name on the command line they will
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
77 be unable to start. So we filter the command line and allow only items in
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
78 this list in.
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
79
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
80 The CDR of the assoc list is whether it accepts an argument. For the
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
81 moment, all options are in GNU long form.")
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
82
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
83 (defvar make-device-early-gtk-entry-point-called-p nil
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
84 "Whether `make-device-early-gtk-entry-point' has been called, at least once.
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
85
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
86 Much of the GTK-specific Lisp init code should only be called the first time
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
87 a GTK device is created; this variable allows for that.")
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
88
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
89 (defvar make-device-late-gtk-entry-point-called-p nil
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
90 "Whether `make-device-late-gtk-entry-point' has been called, at least once.
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
91
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
92 Much of the GTK-specific Lisp init code should only be called the first time
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
93 a GTK device is created; this variable allows for that.")
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
94
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
95 (defun make-device-early-gtk-entry-point ()
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
96 "Entry point to set up the Lisp environment before GTK device creation."
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
97 (unless make-device-early-gtk-entry-point-called-p
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
98 (setq initial-frame-plist
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
99 (and initial-frame-unmapped-p '(initially-unmapped t))
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
100 gtk-initial-argv-list
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
101 (cons (car command-line-args) (gtk-filter-arguments))
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
102 gtk-initial-geometry
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
103 (nth 1 (member "-geometry" command-line-args-left))
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
104 make-device-early-gtk-entry-point-called-p t)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
105 (unless vanilla-inhibiting
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
106 (load gtk-early-lisp-options-file t t t))))
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
107
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
108 (defun gtk-init-handle-geometry (arg)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
109 "Set up initial geometry info for GTK devices."
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
110 (setq gtk-initial-geometry (pop command-line-args-left)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
111
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
112 (defun make-device-late-gtk-entry-point (device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
113 "Entry-Point to do any Lisp-level GTK device-specific initialization."
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
114 (gtk-initialize-compose device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
115 (unless make-device-late-gtk-entry-point-called-p
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
116 (setq make-device-late-gtk-entry-point-called-p t)))
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
117
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
118 (defun gtk-filter-arguments ()
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
119 (let ((accepted nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
120 (rejected nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
121 (todo nil))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
122 (setq todo (mapcar (lambda (argdesc)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
123 (if (cdr argdesc)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
124 ;; Need to look for --foo=bar
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
125 (concat "^" (car argdesc) "=")
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
126 ;; Just a simple arg
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
127 (concat "^" (regexp-quote (car argdesc)) "$")))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
128 gtk-command-switch-alist))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
129
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
130 (while command-line-args-left
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
131 (if (catch 'found
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
132 (mapc (lambda (r)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
133 (if (string-match r (car command-line-args-left))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
134 (throw 'found t))) todo)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
135 (mapc (lambda (argdesc)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
136 (if (cdr argdesc)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
137 ;; This time we only care about argument items
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
138 ;; that take an argument. We'll check to see if
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
139 ;; someone used --foo bar instead of --foo=bar
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
140 (if (string-match (concat "^" (car argdesc) "$") (car command-line-args-left))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
141 ;; Yup! Need to push
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
142 (progn
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
143 (push (pop command-line-args-left) accepted)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
144 (throw 'found t)))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
145 gtk-command-switch-alist)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
146 nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
147 (push (pop command-line-args-left) accepted)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
148 (push (pop command-line-args-left) rejected)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
149 (setq command-line-args-left (nreverse rejected))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
150 (nreverse accepted)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
151
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
152 (push '("-geometry" . gtk-init-handle-geometry) command-switch-alist)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
153
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
154 ;;; Stuff to get compose keys working on GTK
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
155 (eval-when-compile
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
156 (defmacro gtk-define-dead-key (key map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
157 `(when (gtk-keysym-on-keyboard-p ',key device)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
158 (define-key function-key-map [,key] ',map))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
159
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
160 (defun gtk-initialize-compose (device)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
161 "Enable compose processing"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
162 (autoload 'compose-map "gtk-compose" nil t 'keymap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
163 (autoload 'compose-acute-map "gtk-compose" nil t 'keymap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
164 (autoload 'compose-grave-map "gtk-compose" nil t 'keymap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
165 (autoload 'compose-cedilla-map "gtk-compose" nil t 'keymap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
166 (autoload 'compose-diaeresis-map "gtk-compose" nil t 'keymap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
167 (autoload 'compose-circumflex-map "gtk-compose" nil t 'keymap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
168 (autoload 'compose-tilde-map "gtk-compose" nil t 'keymap)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
169
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
170 (when (gtk-keysym-on-keyboard-p 'multi-key device)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
171 (define-key function-key-map [multi-key] 'compose-map))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
172
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
173 ;; The dead keys might really be called just about anything, depending
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
174 ;; on the vendor. MIT thinks that the prefixes are "SunFA_", "D", and
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
175 ;; "hpmute_" for Sun, DEC, and HP respectively. However, OpenWindows 3
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
176 ;; thinks that the prefixes are "SunXK_FA_", "DXK_", and "hpXK_mute_".
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
177 ;; And HP (who don't mention Sun and DEC at all) use "XK_mute_".
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
178 ;; Go figure.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
179
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
180 ;; Presumably if someone is running OpenWindows, they won't be using
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
181 ;; the DEC or HP keysyms, but if they are defined then that is possible,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
182 ;; so in that case we accept them all.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
183
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
184 ;; If things seem not to be working, you might want to check your
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
185 ;; /usr/lib/X11/XKeysymDB file to see if your vendor has an equally
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
186 ;; mixed up view of what these keys should be called.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
187
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
188 ;; Canonical names:
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
189 (gtk-define-dead-key acute compose-acute-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
190 (gtk-define-dead-key grave compose-grave-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
191 (gtk-define-dead-key cedilla compose-cedilla-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
192 (gtk-define-dead-key diaeresis compose-diaeresis-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
193 (gtk-define-dead-key circumflex compose-circumflex-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
194 (gtk-define-dead-key tilde compose-tilde-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
195 (gtk-define-dead-key degree compose-ring-map device)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
196
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
197 ;; Sun according to MIT:
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
198 (gtk-define-dead-key SunFA_Acute compose-acute-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
199 (gtk-define-dead-key SunFA_Grave compose-grave-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
200 (gtk-define-dead-key SunFA_Cedilla compose-cedilla-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
201 (gtk-define-dead-key SunFA_Diaeresis compose-diaeresis-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
202 (gtk-define-dead-key SunFA_Circum compose-circumflex-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
203 (gtk-define-dead-key SunFA_Tilde compose-tilde-map device)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
204
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
205 ;; Sun according to OpenWindows 2:
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
206 (gtk-define-dead-key Dead_Grave compose-grave-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
207 (gtk-define-dead-key Dead_Circum compose-circumflex-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
208 (gtk-define-dead-key Dead_Tilde compose-tilde-map device)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
209
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
210 ;; Sun according to OpenWindows 3:
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
211 (gtk-define-dead-key SunXK_FA_Acute compose-acute-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
212 (gtk-define-dead-key SunXK_FA_Grave compose-grave-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
213 (gtk-define-dead-key SunXK_FA_Cedilla compose-cedilla-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
214 (gtk-define-dead-key SunXK_FA_Diaeresis compose-diaeresis-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
215 (gtk-define-dead-key SunXK_FA_Circum compose-circumflex-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
216 (gtk-define-dead-key SunXK_FA_Tilde compose-tilde-map device)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
217
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
218 ;; DEC according to MIT:
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
219 (gtk-define-dead-key Dacute_accent compose-acute-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
220 (gtk-define-dead-key Dgrave_accent compose-grave-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
221 (gtk-define-dead-key Dcedilla_accent compose-cedilla-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
222 (gtk-define-dead-key Dcircumflex_accent compose-circumflex-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
223 (gtk-define-dead-key Dtilde compose-tilde-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
224 (gtk-define-dead-key Dring_accent compose-ring-map device)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
225
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
226 ;; DEC according to OpenWindows 3:
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
227 (gtk-define-dead-key DXK_acute_accent compose-acute-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
228 (gtk-define-dead-key DXK_grave_accent compose-grave-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
229 (gtk-define-dead-key DXK_cedilla_accent compose-cedilla-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
230 (gtk-define-dead-key DXK_circumflex_accent compose-circumflex-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
231 (gtk-define-dead-key DXK_tilde compose-tilde-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
232 (gtk-define-dead-key DXK_ring_accent compose-ring-map device)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
233
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
234 ;; HP according to MIT:
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
235 (gtk-define-dead-key hpmute_acute compose-acute-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
236 (gtk-define-dead-key hpmute_grave compose-grave-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
237 (gtk-define-dead-key hpmute_diaeresis compose-diaeresis-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
238 (gtk-define-dead-key hpmute_asciicircum compose-circumflex-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
239 (gtk-define-dead-key hpmute_asciitilde compose-tilde-map device)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
240
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
241 ;; Empirically discovered on Linux XFree86 MetroX:
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
242 (gtk-define-dead-key usldead_acute compose-acute-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
243 (gtk-define-dead-key usldead_grave compose-grave-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
244 (gtk-define-dead-key usldead_diaeresis compose-diaeresis-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
245 (gtk-define-dead-key usldead_asciicircum compose-circumflex-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
246 (gtk-define-dead-key usldead_asciitilde compose-tilde-map device)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
247
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
248 ;; HP according to OpenWindows 3:
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
249 (gtk-define-dead-key hpXK_mute_acute compose-acute-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
250 (gtk-define-dead-key hpXK_mute_grave compose-grave-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
251 (gtk-define-dead-key hpXK_mute_diaeresis compose-diaeresis-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
252 (gtk-define-dead-key hpXK_mute_asciicircum compose-circumflex-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
253 (gtk-define-dead-key hpXK_mute_asciitilde compose-tilde-map device)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
254
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
255 ;; HP according to HP-UX 8.0:
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
256 (gtk-define-dead-key XK_mute_acute compose-acute-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
257 (gtk-define-dead-key XK_mute_grave compose-grave-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
258 (gtk-define-dead-key XK_mute_diaeresis compose-diaeresis-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
259 (gtk-define-dead-key XK_mute_asciicircum compose-circumflex-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
260 (gtk-define-dead-key XK_mute_asciitilde compose-tilde-map device)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
261
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
262 ;; Xfree86 seems to use lower case and a hyphen
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
263 (gtk-define-dead-key dead-acute compose-acute-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
264 (gtk-define-dead-key dead-grave compose-grave-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
265 (gtk-define-dead-key dead-cedilla compose-cedilla-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
266 (gtk-define-dead-key dead-diaeresis compose-diaeresis-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
267 (gtk-define-dead-key dead-circum compose-circumflex-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
268 (gtk-define-dead-key dead-circumflex compose-circumflex-map device)
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 4380
diff changeset
269 (gtk-define-dead-key dead-tilde compose-tilde-map device))
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
270