comparison lisp/x-init.el @ 5529:3d1f8f0e690f

Add `function-key-map-parent', for non-console-specific `function-key-map' bindings src/ChangeLog addition: 2011-06-25 Aidan Kehoe <kehoea@parhasard.net> * console.c: * console.c (allocate_console): * console.c (vars_of_console): * console.c (complex_vars_of_console): * lisp.h: Add a new keymap variable, function-key-map-parent; use it as the parent of each console-specific function-key-map. This is appropriate for things like x-compose processing. lisp/ChangeLog addition: 2011-06-25 Aidan Kehoe <kehoea@parhasard.net> * gtk-init.el: * gtk-init.el (make-device-late-gtk-entry-point): * gtk-init.el (gtk-initialize-compose): Removed. * keymap.el: * keymap.el (function-key-map-parent): * x-init.el (x-initialize-compose): Removed. * x-init.el (make-device-late-x-entry-point): Make the bindings for dead-acute and friends in function-key-map-parent, rather than function-key-map; do this in keymap.el rather than in window-system-specific code, since the compose processing is generally useful and not X11-specific. It's probably reasonable to rename x-compose.el to compose.el at this point, but I haven't done that. man/ChangeLog addition: 2011-06-25 Aidan Kehoe <kehoea@parhasard.net> * lispref/os.texi (Translating Input): Document the just-added function-key-map-parent.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 25 Jun 2011 14:00:48 +0100
parents 308d34e9f07d
children 1d1f385c9149
comparison
equal deleted inserted replaced
5528:dc88f282ddc3 5529:3d1f8f0e690f
77 (defun ow-find-backward () 77 (defun ow-find-backward ()
78 "Search backward for the previous occurrence of the text of the selection." 78 "Search backward for the previous occurrence of the text of the selection."
79 (interactive) 79 (interactive)
80 (ow-find t)) 80 (ow-find t))
81 81
82 ;; Load X-server specific code.
83 ;; Specifically, load some code to repair the grievous damage that MIT and
84 ;; Sun have done to the default keymap for the Sun keyboards.
85 (defun x-initialize-compose (device)
86 "Enable compose key and dead key processing on DEVICE."
87 (loop for map in '(compose-map compose-acute-map compose-grave-map
88 compose-cedilla-map compose-diaeresis-map
89 compose-circumflex-map compose-tilde-map
90 compose-ring-map compose-caron-map compose-macron-map
91 compose-breve-map compose-dot-map
92 compose-doubleacute-map compose-ogonek-map
93 compose-hook-map compose-horn-map compose-stroke-map)
94 do (autoload map "x-compose" nil t 'keymap))
95
96 (loop
97 for (key map)
98 ;; The dead keys might really be called just about anything, depending
99 ;; on the vendor. MIT thinks that the prefixes are "SunFA_", "D", and
100 ;; "hpmute_" for Sun, DEC, and HP respectively. However, OpenWindows 3
101 ;; thinks that the prefixes are "SunXK_FA_", "DXK_", and "hpXK_mute_".
102 ;; And HP (who don't mention Sun and DEC at all) use "XK_mute_". Go
103 ;; figure.
104
105 ;; Presumably if someone is running OpenWindows, they won't be using the
106 ;; DEC or HP keysyms, but if they are defined then that is possible, so
107 ;; in that case we accept them all.
108
109 ;; If things seem not to be working, you might want to check your
110 ;; /usr/lib/X11/XKeysymDB file to see if your vendor has an equally
111 ;; mixed up view of what these keys should be called.
112
113 ;; Canonical names:
114 in '((acute compose-acute-map)
115 (grave compose-grave-map)
116 (cedilla compose-cedilla-map)
117 (diaeresis compose-diaeresis-map)
118 (circumflex compose-circumflex-map)
119 (tilde compose-tilde-map)
120 (degree compose-ring-map)
121 (multi-key compose-map)
122
123 ;; Sun according to MIT:
124 (SunFA_Acute compose-acute-map)
125 (SunFA_Grave compose-grave-map)
126 (SunFA_Cedilla compose-cedilla-map)
127 (SunFA_Diaeresis compose-diaeresis-map)
128 (SunFA_Circum compose-circumflex-map)
129 (SunFA_Tilde compose-tilde-map)
130
131 ;; Sun according to OpenWindows 2:
132 (Dead_Grave compose-grave-map)
133 (Dead_Circum compose-circumflex-map)
134 (Dead_Tilde compose-tilde-map)
135
136 ;; Sun according to OpenWindows 3:
137 (SunXK_FA_Acute compose-acute-map)
138 (SunXK_FA_Grave compose-grave-map)
139 (SunXK_FA_Cedilla compose-cedilla-map)
140 (SunXK_FA_Diaeresis compose-diaeresis-map)
141 (SunXK_FA_Circum compose-circumflex-map)
142 (SunXK_FA_Tilde compose-tilde-map)
143
144 ;; DEC according to MIT:
145 (Dacute_accent compose-acute-map)
146 (Dgrave_accent compose-grave-map)
147 (Dcedilla_accent compose-cedilla-map)
148 (Dcircumflex_accent compose-circumflex-map)
149 (Dtilde compose-tilde-map)
150 (Dring_accent compose-ring-map)
151
152 ;; DEC according to OpenWindows 3:
153 (DXK_acute_accent compose-acute-map)
154 (DXK_grave_accent compose-grave-map)
155 (DXK_cedilla_accent compose-cedilla-map)
156 (DXK_circumflex_accent compose-circumflex-map)
157 (DXK_tilde compose-tilde-map)
158 (DXK_ring_accent compose-ring-map)
159
160 ;; HP according to MIT:
161 (hpmute_acute compose-acute-map)
162 (hpmute_grave compose-grave-map)
163 (hpmute_diaeresis compose-diaeresis-map)
164 (hpmute_asciicircum compose-circumflex-map)
165 (hpmute_asciitilde compose-tilde-map)
166
167 ;; Empirically discovered on Linux XFree86 MetroX:
168 (usldead_acute compose-acute-map)
169 (usldead_grave compose-grave-map)
170 (usldead_diaeresis compose-diaeresis-map)
171 (usldead_asciicircum compose-circumflex-map)
172 (usldead_asciitilde compose-tilde-map)
173
174 ;; HP according to OpenWindows 3:
175 (hpXK_mute_acute compose-acute-map)
176 (hpXK_mute_grave compose-grave-map)
177 (hpXK_mute_diaeresis compose-diaeresis-map)
178 (hpXK_mute_asciicircum compose-circumflex-map)
179 (hpXK_mute_asciitilde compose-tilde-map)
180
181 ;; HP according to HP-UX 8.0:
182 (XK_mute_acute compose-acute-map)
183 (XK_mute_grave compose-grave-map)
184 (XK_mute_diaeresis compose-diaeresis-map)
185 (XK_mute_asciicircum compose-circumflex-map)
186 (XK_mute_asciitilde compose-tilde-map)
187
188 ;; [[ XFree86 seems to use lower case and a hyphen ]] Not true;
189 ;; they use lower case and an underscore. XEmacs converts the
190 ;; underscore to a hyphen in x_keysym_to_emacs_keysym because the
191 ;; keysym is in the "Keyboard" character set, which is just totally
192 ;; fucking random, considering it doesn't happen for any other
193 ;; character sets.
194 (dead-acute compose-acute-map)
195 (dead-grave compose-grave-map)
196 (dead-cedilla compose-cedilla-map)
197 (dead-diaeresis compose-diaeresis-map)
198 (dead-circum compose-circumflex-map)
199 (dead-circumflex compose-circumflex-map)
200 (dead-tilde compose-tilde-map)
201 (dead-abovering compose-ring-map)
202 (dead-caron compose-caron-map)
203 (dead-macron compose-macron-map)
204 (dead-breve compose-breve-map)
205 (dead-abovedot compose-dot-map)
206 (dead-doubleacute compose-doubleacute-map)
207 (dead-ogonek compose-ogonek-map)
208 (dead-hook compose-hook-map)
209 (dead-horn compose-horn-map)
210 (dead-stroke compose-stroke-map))
211
212 ;; Get the correct value for function-key-map
213 with function-key-map = (symbol-value-in-console 'function-key-map
214 (device-console device)
215 function-key-map)
216 do (when (x-keysym-on-keyboard-p key device)
217 (define-key function-key-map (vector key) map))))
218
219 (eval-when-compile 82 (eval-when-compile
220 (load "x-win-sun" nil t) 83 (load "x-win-sun" nil t)
221 (load "x-win-xfree86" nil t)) 84 (load "x-win-xfree86" nil t))
222 85
223 (defun x-initialize-keyboard (device) 86 (defun x-initialize-keyboard (device)
289 152
290 (defun make-device-late-x-entry-point (device) 153 (defun make-device-late-x-entry-point (device)
291 "Entry point to do any Lisp-level X device-specific initialization." 154 "Entry point to do any Lisp-level X device-specific initialization."
292 ;; General code, called on every X device created: 155 ;; General code, called on every X device created:
293 (x-initialize-keyboard device) 156 (x-initialize-keyboard device)
294 (x-initialize-compose device)
295 ;; And the following code is to be called once, the first time an X11 157 ;; And the following code is to be called once, the first time an X11
296 ;; device is created: 158 ;; device is created:
297 (unless make-device-late-x-entry-point-called-p 159 (unless make-device-late-x-entry-point-called-p
298 (setq command-line-args-left (cdr x-initial-argv-list)) 160 (setq command-line-args-left (cdr x-initial-argv-list))
299 ;; Motif-ish bindings 161 ;; Motif-ish bindings