Mercurial > hg > xemacs-beta
comparison lisp/x11/x-compose.el @ 155:43dd3413c7c7 r20-3b4
Import from CVS: tag r20-3b4
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:39:39 +0200 |
parents | 8619ce7e4c50 |
children | 3bb7ccffb0c0 |
comparison
equal
deleted
inserted
replaced
154:94141801dd7e | 155:43dd3413c7c7 |
---|---|
1 ;; Compose-key processing in emacs. | 1 ;;; x-compose.el --- Compose-key processing in XEmacs |
2 ;; Copyright (C) 1992, 1993 Free Software Foundation, Inc. | 2 |
3 ;; Copyright (C) 1992, 1993, 1997 Free Software Foundation, Inc. | |
4 | |
5 ;; Author: Jamie Zawinski <jwz@netscape.com> | |
6 ;; Maintainer: XEmacs Development Team | |
7 ;; Keywords: i18n | |
3 | 8 |
4 ;; This file is part of XEmacs. | 9 ;; This file is part of XEmacs. |
5 | 10 |
6 ;; XEmacs is free software; you can redistribute it and/or modify it | 11 ;; XEmacs is free software; you can redistribute it and/or modify it |
7 ;; under the terms of the GNU General Public License as published by | 12 ;; under the terms of the GNU General Public License as published by |
16 ;; You should have received a copy of the GNU General Public License | 21 ;; You should have received a copy of the GNU General Public License |
17 ;; along with XEmacs; see the file COPYING. If not, write to the | 22 ;; along with XEmacs; see the file COPYING. If not, write to the |
18 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
19 ;; Boston, MA 02111-1307, USA. | 24 ;; Boston, MA 02111-1307, USA. |
20 | 25 |
21 ;;; created by jwz, 14-jun-92. | 26 ;;; Synched up with: Not in FSF. |
22 | 27 |
23 ;;; This file implements DEC-, OpenWindows-, and HP-compatible "Compose" | 28 ;;; Commentary: |
24 ;;; processing for XEmacs. | 29 |
25 ;;; | 30 ;; created by jwz, 14-jun-92. |
26 ;;; If you are running a version of X which already does compose processing, | 31 |
27 ;;; then you don't need this file. But the MIT R4 and R5 distributions don't | 32 ;; This file implements DEC-, OpenWindows-, and HP-compatible "Compose" |
28 ;;; do compose processing, so you may want to fake it by using this code. | 33 ;; processing for XEmacs. |
29 ;;; | 34 |
30 ;;; The basic idea is that there are several ways to generate keysyms which | 35 ;; If you are running a version of X which already does compose processing, |
31 ;;; do not have keys devoted to them on your keyboard. | 36 ;; then you don't need this file. But the MIT R4 and R5 distributions don't |
32 ;;; | 37 ;; do compose processing, so you may want to fake it by using this code. |
33 ;;; The first method is by using "dead" keys. A dead key is a key which, | 38 |
34 ;;; when typed, does not insert a character. Instead it modifies the | 39 ;; The basic idea is that there are several ways to generate keysyms which |
35 ;;; following character typed. So if you typed "dead-tilde" followed by "A", | 40 ;; do not have keys devoted to them on your keyboard. |
36 ;;; then "A-tilde" would be inserted. Of course, this requires you to modify | 41 |
37 ;;; your keyboard to include a "dead-tilde" key on it somewhere. | 42 ;; The first method is by using "dead" keys. A dead key is a key which, |
38 ;;; | 43 ;; when typed, does not insert a character. Instead it modifies the |
39 ;;; The second method is by using a "Compose" key. With a Compose key, you | 44 ;; following character typed. So if you typed "dead-tilde" followed by "A", |
40 ;;; would type "Compose" then "tilde" then "A" to insert "A-tilde". | 45 ;; then "A-tilde" would be inserted. Of course, this requires you to modify |
41 ;;; | 46 ;; your keyboard to include a "dead-tilde" key on it somewhere. |
42 ;;; There are a small number of dead keys: acute, grave, cedilla, diaeresis, | 47 |
43 ;;; circumflex, tilde, and ring. There are a larger number of accented and | 48 ;; The second method is by using a "Compose" key. With a Compose key, you |
44 ;;; other characters accessible via the Compose key, so both are useful. | 49 ;; would type "Compose" then "tilde" then "A" to insert "A-tilde". |
45 ;;; | 50 |
46 ;;; To use this code, you will need to have a Compose key on your keyboard. | 51 ;; There are a small number of dead keys: acute, grave, cedilla, diaeresis, |
47 ;;; The default configuration of most X keyboards doesn't contain one. You | 52 ;; circumflex, tilde, and ring. There are a larger number of accented and |
48 ;;; can, for example, turn the right "Meta" key into a "Compose" key with | 53 ;; other characters accessible via the Compose key, so both are useful. |
49 ;;; this command: | 54 |
50 ;;; | 55 ;; To use this code, you will need to have a Compose key on your keyboard. |
51 ;;; xmodmap -e "remove mod1 = Meta_R" -e "keysym Meta_R = Multi_key" | 56 ;; The default configuration of most X keyboards doesn't contain one. You |
52 ;;; | 57 ;; can, for example, turn the right "Meta" key into a "Compose" key with |
53 ;;; Multi-key is the name that X (and emacs) know the "Compose" key by. | 58 ;; this command: |
54 ;;; The "remove..." command is necessary because the "Compose" key must not | 59 |
55 ;;; have any modifier bits associated with it. This exact command may not | 60 ;; xmodmap -e "remove mod1 = Meta_R" -e "keysym Meta_R = Multi_key" |
56 ;;; work, depending on what system and keyboard you are using. If it | 61 |
57 ;;; doesn't, you'll have to read the man page for xmodmap. You might want | 62 ;; Multi-key is the name that X (and emacs) know the "Compose" key by. |
58 ;;; to get the "xkeycaps" program from the host export.lcs.mit.edu in the | 63 ;; The "remove..." command is necessary because the "Compose" key must not |
59 ;;; file contrib/xkeycaps.tar.Z, which is a graphical front end to xmodmap | 64 ;; have any modifier bits associated with it. This exact command may not |
60 ;;; that hides xmodmap's arcane syntax from you. | 65 ;; work, depending on what system and keyboard you are using. If it |
61 ;;; | 66 ;; doesn't, you'll have to read the man page for xmodmap. You might want |
62 ;;; If for some reason you don't want to have a dedicated compose key on your | 67 ;; to get the "xkeycaps" program from the host export.lcs.mit.edu in the |
63 ;;; keyboard, you can use some other key as the prefix. For example, to make | 68 ;; file contrib/xkeycaps.tar.Z, which is a graphical front end to xmodmap |
64 ;;; "Meta-Shift-C" act as a compose key (so that "M-C , c" would insert the | 69 ;; that hides xmodmap's arcane syntax from you. |
65 ;;; character "ccedilla") you could do | 70 |
66 ;;; | 71 ;; If for some reason you don't want to have a dedicated compose key on your |
67 ;;; (global-set-key "\M-C" compose-map) | 72 ;; keyboard, you can use some other key as the prefix. For example, to make |
68 ;;; | 73 ;; "Meta-Shift-C" act as a compose key (so that "M-C , c" would insert the |
69 ;;; I believe the bindings encoded in this file are the same as those used | 74 ;; character "ccedilla") you could do |
70 ;;; by OpenWindows versions 2 and 3, and DEC VT320 terminals. Please let me | 75 |
71 ;;; know if you think otherwise. | 76 ;; (global-set-key "\M-C" compose-map) |
72 ;;; | 77 |
73 ;;; Much thanks to Justin Bur <justin@crim.ca> for helping me understand how | 78 ;; I believe the bindings encoded in this file are the same as those used |
74 ;;; this stuff is supposed to work. | 79 ;; by OpenWindows versions 2 and 3, and DEC VT320 terminals. Please let me |
75 ;;; | 80 ;; know if you think otherwise. |
76 ;;; You also might want to consider getting Justin's patch for the MIT Xlib | 81 |
77 ;;; that implements compose processing in the library. This will enable | 82 ;; Much thanks to Justin Bur <justin@crim.ca> for helping me understand how |
78 ;;; compose processing in applications other than emacs as well. You can | 83 ;; this stuff is supposed to work. |
79 ;;; get it from export.lcs.mit.edu in contrib/compose.tar.Z. | 84 |
80 | 85 ;; You also might want to consider getting Justin's patch for the MIT Xlib |
81 ;;; This code has one feature that a more "builtin" Compose mechanism could | 86 ;; that implements compose processing in the library. This will enable |
82 ;;; not have: at any point you can type C-h to get a list of the possible | 87 ;; compose processing in applications other than emacs as well. You can |
83 ;;; completions of what you have typed so far. | 88 ;; get it from export.lcs.mit.edu in contrib/compose.tar.Z. |
89 | |
90 ;; This code has one feature that a more "builtin" Compose mechanism could | |
91 ;; not have: at any point you can type C-h to get a list of the possible | |
92 ;; completions of what you have typed so far. | |
93 | |
94 ;;; Code: | |
84 | 95 |
85 (require 'x-iso8859-1) | 96 (require 'x-iso8859-1) |
86 | 97 |
87 (defvar compose-map (make-keymap)) | 98 (defvar compose-map (make-keymap)) |
88 (defvar compose-acute-map (make-sparse-keymap)) | 99 (defvar compose-acute-map (make-sparse-keymap)) |
780 (if (memq (default-value 'ctl-arrow) '(t nil)) | 791 (if (memq (default-value 'ctl-arrow) '(t nil)) |
781 (setq-default ctl-arrow 'iso-8859/1)) | 792 (setq-default ctl-arrow 'iso-8859/1)) |
782 | 793 |
783 | 794 |
784 (provide 'x-compose) | 795 (provide 'x-compose) |
796 | |
797 ;;; x-compose.el ends here |