Mercurial > hg > xemacs-beta
annotate lisp/x-init.el @ 5448:89331fa1c819
Merged with trunk.
| author | Mats Lidell <matsl@xemacs.org> |
|---|---|
| date | Thu, 06 Jan 2011 00:35:22 +0100 |
| parents | 308d34e9f07d |
| children | 3d1f8f0e690f |
| rev | line source |
|---|---|
| 428 | 1 ;;; x-init.el --- initialization code for X windows |
| 2 | |
| 3 ;; Copyright (C) 1990, 1993, 1994, 1997 Free Software Foundation, Inc. | |
| 4 ;; Copyright (C) 1995 Board of Trustees, University of Illinois. | |
| 5 ;; Copyright (C) 1995, 1996 Ben Wing. | |
| 6 | |
| 7 ;; Maintainer: XEmacs Development Team | |
| 8 ;; Keywords: terminals, dumped | |
| 9 | |
| 10 ;; This file is part of XEmacs. | |
| 11 | |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5260
diff
changeset
|
12 ;; XEmacs is free software: you can redistribute it and/or modify it |
|
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5260
diff
changeset
|
13 ;; under the terms of the GNU General Public License as published by the |
|
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5260
diff
changeset
|
14 ;; Free Software Foundation, either version 3 of the License, or (at your |
|
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5260
diff
changeset
|
15 ;; option) any later version. |
| 428 | 16 |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5260
diff
changeset
|
17 ;; XEmacs is distributed in the hope that it will be useful, but WITHOUT |
|
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5260
diff
changeset
|
18 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5260
diff
changeset
|
19 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5260
diff
changeset
|
20 ;; for more details. |
| 428 | 21 |
| 22 ;; You should have received a copy of the GNU General Public License | |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5260
diff
changeset
|
23 ;; along with XEmacs. If not, see <http://www.gnu.org/licenses/>. |
| 428 | 24 |
| 25 ;;; Synched up with: Not synched. | |
| 26 | |
| 27 ;;; Commentary: | |
| 28 | |
| 29 ;; This file is dumped with XEmacs (when X support is compiled in). | |
| 30 | |
| 31 ;;; Code: | |
| 32 | |
| 502 | 33 (globally-declare-fboundp |
| 34 '(x-keysym-on-keyboard-p | |
| 35 x-server-vendor x-init-specifier-from-resources init-mule-x-win)) | |
| 36 | |
| 37 (globally-declare-boundp | |
|
4477
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
38 '(x-initial-argv-list x-app-defaults-directory)) |
| 502 | 39 |
| 428 | 40 ;; If you want to change this variable, this is the place you must do it. |
| 41 ;; Do not set it to a string containing periods. X doesn't like that. | |
| 42 ;(setq x-emacs-application-class "Emacs") | |
| 43 | |
| 44 (defgroup x nil | |
| 45 "The X Window system." | |
| 46 :group 'environment) | |
| 47 | |
| 48 ;; OpenWindows-like "find" processing. These functions are really Sunisms, | |
| 49 ;; but we put them here instead of in x-win-sun.el in case someone wants | |
| 50 ;; to use them when not running on a Sun console (presumably after binding | |
| 51 ;; them to different keys, or putting them on menus.) | |
| 52 | |
| 53 (defvar ow-find-last-string nil) | |
| 54 (defvar ow-find-last-clipboard nil) | |
| 55 | |
| 56 (defun ow-find (&optional backward-p) | |
| 57 "Search forward the next occurrence of the text of the selection." | |
| 58 (interactive) | |
| 442 | 59 (let ((sel (ignore-errors (get-selection))) |
| 60 (clip (ignore-errors (get-clipboard))) | |
| 428 | 61 text) |
| 62 (setq text (cond | |
| 63 (sel) | |
| 64 ((not (equal clip ow-find-last-clipboard)) | |
| 65 (setq ow-find-last-clipboard clip)) | |
| 66 (ow-find-last-string) | |
| 67 (t (error "No selection available")))) | |
| 68 (setq ow-find-last-string text) | |
| 69 (cond (backward-p | |
| 70 (search-backward text) | |
| 71 (set-mark (+ (point) (length text)))) | |
| 72 (t | |
| 73 (search-forward text) | |
| 74 (set-mark (- (point) (length text))))) | |
| 75 (zmacs-activate-region))) | |
| 76 | |
| 77 (defun ow-find-backward () | |
| 78 "Search backward for the previous occurrence of the text of the selection." | |
| 79 (interactive) | |
| 80 (ow-find t)) | |
| 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. | |
|
4477
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
85 (defun x-initialize-compose (device) |
|
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
86 "Enable compose key and dead key processing on DEVICE." |
|
4627
fdc76fec36d3
Vastly expand the characters x-compose.el supports.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4489
diff
changeset
|
87 (loop for map in '(compose-map compose-acute-map compose-grave-map |
|
fdc76fec36d3
Vastly expand the characters x-compose.el supports.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4489
diff
changeset
|
88 compose-cedilla-map compose-diaeresis-map |
|
fdc76fec36d3
Vastly expand the characters x-compose.el supports.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4489
diff
changeset
|
89 compose-circumflex-map compose-tilde-map |
|
fdc76fec36d3
Vastly expand the characters x-compose.el supports.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4489
diff
changeset
|
90 compose-ring-map compose-caron-map compose-macron-map |
|
fdc76fec36d3
Vastly expand the characters x-compose.el supports.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4489
diff
changeset
|
91 compose-breve-map compose-dot-map |
|
fdc76fec36d3
Vastly expand the characters x-compose.el supports.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4489
diff
changeset
|
92 compose-doubleacute-map compose-ogonek-map |
|
5260
dceee3855f15
Add support for the X11 dead-stroke in x-compose.el.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4627
diff
changeset
|
93 compose-hook-map compose-horn-map compose-stroke-map) |
|
4627
fdc76fec36d3
Vastly expand the characters x-compose.el supports.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4489
diff
changeset
|
94 do (autoload map "x-compose" nil t 'keymap)) |
| 428 | 95 |
|
4482
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
96 (loop |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
97 for (key map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
98 ;; The dead keys might really be called just about anything, depending |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
99 ;; on the vendor. MIT thinks that the prefixes are "SunFA_", "D", and |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
100 ;; "hpmute_" for Sun, DEC, and HP respectively. However, OpenWindows 3 |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
101 ;; thinks that the prefixes are "SunXK_FA_", "DXK_", and "hpXK_mute_". |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
102 ;; And HP (who don't mention Sun and DEC at all) use "XK_mute_". Go |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
103 ;; figure. |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
104 |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
105 ;; Presumably if someone is running OpenWindows, they won't be using the |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
106 ;; DEC or HP keysyms, but if they are defined then that is possible, so |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
107 ;; in that case we accept them all. |
| 428 | 108 |
|
4482
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
109 ;; If things seem not to be working, you might want to check your |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
110 ;; /usr/lib/X11/XKeysymDB file to see if your vendor has an equally |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
111 ;; mixed up view of what these keys should be called. |
| 428 | 112 |
|
4482
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
113 ;; Canonical names: |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
114 in '((acute compose-acute-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
115 (grave compose-grave-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
116 (cedilla compose-cedilla-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
117 (diaeresis compose-diaeresis-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
118 (circumflex compose-circumflex-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
119 (tilde compose-tilde-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
120 (degree compose-ring-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
121 (multi-key compose-map) |
| 428 | 122 |
|
4482
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
123 ;; Sun according to MIT: |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
124 (SunFA_Acute compose-acute-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
125 (SunFA_Grave compose-grave-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
126 (SunFA_Cedilla compose-cedilla-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
127 (SunFA_Diaeresis compose-diaeresis-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
128 (SunFA_Circum compose-circumflex-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
129 (SunFA_Tilde compose-tilde-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
130 |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
131 ;; Sun according to OpenWindows 2: |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
132 (Dead_Grave compose-grave-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
133 (Dead_Circum compose-circumflex-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
134 (Dead_Tilde compose-tilde-map) |
| 428 | 135 |
|
4482
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
136 ;; Sun according to OpenWindows 3: |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
137 (SunXK_FA_Acute compose-acute-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
138 (SunXK_FA_Grave compose-grave-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
139 (SunXK_FA_Cedilla compose-cedilla-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
140 (SunXK_FA_Diaeresis compose-diaeresis-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
141 (SunXK_FA_Circum compose-circumflex-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
142 (SunXK_FA_Tilde compose-tilde-map) |
| 428 | 143 |
|
4482
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
144 ;; DEC according to MIT: |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
145 (Dacute_accent compose-acute-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
146 (Dgrave_accent compose-grave-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
147 (Dcedilla_accent compose-cedilla-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
148 (Dcircumflex_accent compose-circumflex-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
149 (Dtilde compose-tilde-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
150 (Dring_accent compose-ring-map) |
| 428 | 151 |
|
4482
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
152 ;; DEC according to OpenWindows 3: |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
153 (DXK_acute_accent compose-acute-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
154 (DXK_grave_accent compose-grave-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
155 (DXK_cedilla_accent compose-cedilla-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
156 (DXK_circumflex_accent compose-circumflex-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
157 (DXK_tilde compose-tilde-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
158 (DXK_ring_accent compose-ring-map) |
| 428 | 159 |
|
4482
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
160 ;; HP according to MIT: |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
161 (hpmute_acute compose-acute-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
162 (hpmute_grave compose-grave-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
163 (hpmute_diaeresis compose-diaeresis-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
164 (hpmute_asciicircum compose-circumflex-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
165 (hpmute_asciitilde compose-tilde-map) |
| 428 | 166 |
|
4482
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
167 ;; Empirically discovered on Linux XFree86 MetroX: |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
168 (usldead_acute compose-acute-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
169 (usldead_grave compose-grave-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
170 (usldead_diaeresis compose-diaeresis-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
171 (usldead_asciicircum compose-circumflex-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
172 (usldead_asciitilde compose-tilde-map) |
| 428 | 173 |
|
4482
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
174 ;; HP according to OpenWindows 3: |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
175 (hpXK_mute_acute compose-acute-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
176 (hpXK_mute_grave compose-grave-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
177 (hpXK_mute_diaeresis compose-diaeresis-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
178 (hpXK_mute_asciicircum compose-circumflex-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
179 (hpXK_mute_asciitilde compose-tilde-map) |
| 428 | 180 |
|
4482
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
181 ;; HP according to HP-UX 8.0: |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
182 (XK_mute_acute compose-acute-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
183 (XK_mute_grave compose-grave-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
184 (XK_mute_diaeresis compose-diaeresis-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
185 (XK_mute_asciicircum compose-circumflex-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
186 (XK_mute_asciitilde compose-tilde-map) |
| 428 | 187 |
|
4482
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
188 ;; [[ XFree86 seems to use lower case and a hyphen ]] Not true; |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
189 ;; they use lower case and an underscore. XEmacs converts the |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
190 ;; underscore to a hyphen in x_keysym_to_emacs_keysym because the |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
191 ;; keysym is in the "Keyboard" character set, which is just totally |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
192 ;; fucking random, considering it doesn't happen for any other |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
193 ;; character sets. |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
194 (dead-acute compose-acute-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
195 (dead-grave compose-grave-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
196 (dead-cedilla compose-cedilla-map) |
|
4627
fdc76fec36d3
Vastly expand the characters x-compose.el supports.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4489
diff
changeset
|
197 (dead-diaeresis compose-diaeresis-map) |
|
4482
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
198 (dead-circum compose-circumflex-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
199 (dead-circumflex compose-circumflex-map) |
|
4627
fdc76fec36d3
Vastly expand the characters x-compose.el supports.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4489
diff
changeset
|
200 (dead-tilde compose-tilde-map) |
|
fdc76fec36d3
Vastly expand the characters x-compose.el supports.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4489
diff
changeset
|
201 (dead-abovering compose-ring-map) |
|
fdc76fec36d3
Vastly expand the characters x-compose.el supports.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4489
diff
changeset
|
202 (dead-caron compose-caron-map) |
|
fdc76fec36d3
Vastly expand the characters x-compose.el supports.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4489
diff
changeset
|
203 (dead-macron compose-macron-map) |
|
fdc76fec36d3
Vastly expand the characters x-compose.el supports.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4489
diff
changeset
|
204 (dead-breve compose-breve-map) |
|
fdc76fec36d3
Vastly expand the characters x-compose.el supports.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4489
diff
changeset
|
205 (dead-abovedot compose-dot-map) |
|
fdc76fec36d3
Vastly expand the characters x-compose.el supports.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4489
diff
changeset
|
206 (dead-doubleacute compose-doubleacute-map) |
|
fdc76fec36d3
Vastly expand the characters x-compose.el supports.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4489
diff
changeset
|
207 (dead-ogonek compose-ogonek-map) |
|
fdc76fec36d3
Vastly expand the characters x-compose.el supports.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4489
diff
changeset
|
208 (dead-hook compose-hook-map) |
|
5260
dceee3855f15
Add support for the X11 dead-stroke in x-compose.el.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4627
diff
changeset
|
209 (dead-horn compose-horn-map) |
|
dceee3855f15
Add support for the X11 dead-stroke in x-compose.el.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4627
diff
changeset
|
210 (dead-stroke compose-stroke-map)) |
|
4482
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
211 |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
212 ;; Get the correct value for function-key-map |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
213 with function-key-map = (symbol-value-in-console 'function-key-map |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
214 (device-console device) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
215 function-key-map) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
216 do (when (x-keysym-on-keyboard-p key device) |
|
e3ef34f57070
Bind function-key-map correctly in device-specific startup code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4477
diff
changeset
|
217 (define-key function-key-map (vector key) map)))) |
| 428 | 218 |
| 219 (eval-when-compile | |
| 220 (load "x-win-sun" nil t) | |
| 221 (load "x-win-xfree86" nil t)) | |
| 222 | |
|
4477
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
223 (defun x-initialize-keyboard (device) |
| 428 | 224 "Perform X-Server-specific initializations. Don't call this." |
| 225 ;; This is some heuristic junk that tries to guess whether this is | |
| 226 ;; a Sun keyboard. | |
| 227 ;; | |
| 228 ;; One way of implementing this (which would require C support) would | |
| 229 ;; be to examine the X keymap itself and see if the layout looks even | |
| 230 ;; remotely like a Sun - check for the Find key on a particular | |
| 231 ;; keycode, for example. It'd be nice to have a table of this to | |
| 232 ;; recognize various keyboards; see also xkeycaps. | |
| 233 ;; | |
| 234 ;; Note that we cannot use most vendor-provided proprietary keyboard | |
| 235 ;; APIs to identify the keyboard - those only work on the console. | |
| 236 ;; xkeycaps has the same problem when running `remotely'. | |
|
4477
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
237 (let ((vendor (x-server-vendor device))) |
| 428 | 238 (cond ((or (string-match "Sun Microsystems" vendor) |
| 239 ;; MIT losingly fails to tell us what hardware the X server | |
| 240 ;; is managing, so assume all MIT displays are Suns... HA HA! | |
| 241 (string-equal "MIT X Consortium" vendor) | |
| 242 (string-equal "X Consortium" vendor)) | |
| 243 ;; Ok, we think this could be a Sun keyboard. Run the Sun code. | |
|
4477
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
244 (x-win-init-sun device)) |
| 4062 | 245 ((string-match #r"XFree86\|Cygwin/X\|The X\.Org Foundation" vendor) |
| 428 | 246 ;; Those XFree86 people do some weird keysym stuff, too. |
|
4477
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
247 (x-win-init-xfree86 device))))) |
| 428 | 248 |
| 3360 | 249 ;; Moved from x-toolbar.el, since InfoDock doesn't dump x-toolbar.el. |
| 428 | 250 (defun x-init-toolbar-from-resources (locale) |
| 251 (loop for (specifier . resname) in | |
| 252 `(( ,top-toolbar-height . "topToolBarHeight") | |
| 253 (,bottom-toolbar-height . "bottomToolBarHeight") | |
| 254 ( ,left-toolbar-width . "leftToolBarWidth") | |
| 255 ( ,right-toolbar-width . "rightToolBarWidth") | |
| 256 | |
| 257 ( ,top-toolbar-border-width . "topToolBarBorderWidth") | |
| 258 (,bottom-toolbar-border-width . "bottomToolBarBorderWidth") | |
| 259 ( ,left-toolbar-border-width . "leftToolBarBorderWidth") | |
| 260 ( ,right-toolbar-border-width . "rightToolBarBorderWidth")) | |
| 261 do | |
| 262 (x-init-specifier-from-resources | |
| 263 specifier 'natnum locale (cons resname (upcase-initials resname))))) | |
| 264 | |
|
4477
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
265 (defvar make-device-early-x-entry-point-called-p nil |
|
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
266 "Whether `make-device-early-x-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:
4451
diff
changeset
|
267 |
|
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
268 Much of the X11-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:
4451
diff
changeset
|
269 an X11 device is created; this variable allows for that.") |
| 428 | 270 |
|
4477
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
271 (defvar make-device-late-x-entry-point-called-p nil |
|
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
272 "Whether `make-device-late-x-entry-point' has been called, at least once. |
| 428 | 273 |
|
4477
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
274 Much of the X11-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:
4451
diff
changeset
|
275 an X11 device is created; this variable allows for that.") |
| 428 | 276 |
|
4477
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
277 (defun make-device-early-x-entry-point () |
|
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
278 "Entry point to set up the Lisp environment for X device creation." |
|
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
279 (unless make-device-early-x-entry-point-called-p |
|
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
280 (setq initial-frame-plist |
|
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
281 (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:
4451
diff
changeset
|
282 ;; Save the argv value. |
|
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
283 x-initial-argv-list |
|
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
284 (cons (car command-line-args) command-line-args-left) |
|
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
285 ;; Locate the app-defaults directory |
|
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
286 x-app-defaults-directory |
|
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
287 (or x-app-defaults-directory (locate-data-directory "app-defaults")) |
|
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
288 make-device-early-x-entry-point-called-p t))) |
|
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
289 |
|
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
290 (defun make-device-late-x-entry-point (device) |
|
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
291 "Entry point to do any Lisp-level X device-specific initialization." |
|
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
292 ;; General code, called on every X device created: |
|
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
293 (x-initialize-keyboard device) |
|
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
294 (x-initialize-compose device) |
|
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
295 ;; And the following code is to be called once, the first time an X11 |
|
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
296 ;; device is created: |
|
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
297 (unless make-device-late-x-entry-point-called-p |
| 428 | 298 (setq command-line-args-left (cdr x-initial-argv-list)) |
| 299 ;; Motif-ish bindings | |
| 300 (define-key global-map '(shift insert) 'yank-clipboard-selection) | |
| 301 (define-key global-map '(control insert) 'copy-primary-selection) | |
| 302 ;; These are Sun-isms. | |
| 303 (define-key global-map 'copy 'copy-primary-selection) | |
| 304 (define-key global-map 'paste 'yank-clipboard-selection) | |
| 305 (define-key global-map 'cut 'kill-primary-selection) | |
|
4477
e34711681f30
Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
306 (setq make-device-late-x-entry-point-called-p t))) |
| 428 | 307 |
| 308 (defun make-frame-on-display (display &optional props) | |
| 309 "Create a frame on the X display named DISPLAY. | |
| 310 DISPLAY should be a standard display string such as \"unix:0\", | |
| 311 or nil for the display specified on the command line or in the | |
| 312 DISPLAY environment variable. | |
| 313 | |
| 314 PROPS should be a plist of properties, as in the call to `make-frame'. | |
| 315 | |
| 316 This function opens a connection to the display or reuses an existing | |
| 317 connection. | |
| 318 | |
| 319 This function is a trivial wrapper around `make-frame-on-device'." | |
| 320 (interactive "sMake frame on display: ") | |
| 321 (if (equal display "") (setq display nil)) | |
| 322 (make-frame-on-device 'x display props)) | |
| 323 | |
| 324 ;;; x-init.el ends here |
