Remove non-free old and crusty clearcase pkg
[packages] / mule-packages / latin-euro-standards / latin-euro-latin9.el
1 ;;; latin-euro-latin9.el --- Define language environment
2
3 ;; Copyright (C) 2002, 2003 Free Software Foundation, Inc
4
5 ;; Author: Stephen J. Turnbull
6 ;; Keywords: mule, charsets
7 ;; Created: 2002 March 7 (as latin-unity-latin9.el)
8 ;; Last-modified: 2005 February 7
9
10 ;; This file is part of XEmacs.
11
12 ;; XEmacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; any later version.
16
17 ;; XEmacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 ;; GNU General Public License for more details.
21
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with XEmacs; see the file COPYING.  If not, write to the
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25 ;; Boston, MA 02111-1307, USA.
26
27
28 ;;; Commentary:
29
30 ;; Provides the latin-9 language environment, character set and coding
31 ;; system.
32
33 ;;; Code:
34
35 ;; define ISO-8859-15 for XEmacs 21.4 and earlier
36
37 ;;;###autoload
38 (unless (find-charset 'latin-iso8859-15)
39   ;; Create character set
40   (make-charset
41    'latin-iso8859-15 "ISO8859-15 (Latin 9)"
42    '(short-name "Latin-9"
43      long-name "ISO8859-15 (Latin 9)"
44      registry "iso8859-15"
45      dimension 1
46      columns 1
47      chars 96
48      final ?b
49      graphic 1
50      direction l2r))
51   ;; For syntax of Latin-9 characters.
52   (loop for c from 64 to 127            ; from 'À' to 'ÿ'
53     do (modify-syntax-entry (make-char 'latin-iso8859-15 c) "w"))
54   (loop for c in '(#xA6 #xA8 #xB4 #xB8 #xBC #xBD #xBE)
55     do (modify-syntax-entry (make-char 'latin-iso8859-15 c) "w"))
56   (modify-syntax-entry (make-char 'latin-iso8859-15 32) "w") ; no-break space
57   (modify-syntax-entry (make-char 'latin-iso8859-15 87) "_") ; multiply
58   (modify-syntax-entry (make-char 'latin-iso8859-15 119) "_")) ; divide
59
60 ;;;###autoload
61 (unless (find-coding-system 'iso-8859-15)
62   ;; Create coding system. No need for a `safe-charsets' parameter, if an
63   ;; XEmacs can handle that, it has this coding system built in.
64   (make-coding-system
65    'iso-8859-15 'iso2022 "MIME ISO-8859-15"
66    '(charset-g0 ascii
67      charset-g1 latin-iso8859-15
68      charset-g2 t                       ; grrr
69      charset-g3 t                       ; grrr
70      mnemonic "MIME/Ltn-9")))
71
72 ;;;###autoload
73 (unless (assoc "Latin-9" language-info-alist)
74   (defun setup-latin9-environment ()
75     "Set up multilingual environment (MULE) for European Latin-9 users."
76     (interactive)
77     (set-language-environment "Latin-9"))
78
79   (set-language-info-alist
80    "Latin-9"
81    `((charset ascii latin-iso8859-15)
82      (coding-system . iso-8859-15)
83      (coding-priority . iso-8859-15)
84      (input-method . "latin-9-prefix")
85      (sample-text . ,(format "\
86 Hello, Hej, Tere, Hei, Bonjour, Gr%c%c Gott, Ciao, %cHola!, my %c0.02"
87                              ;; SMALL U WITH UMLAUT
88                              (make-char 'latin-iso8859-15 #x7C)
89                              ;; GERMAN SHARP S
90                              (make-char 'latin-iso8859-15 #x5F)
91                              ;; INVERTED EXCLAMATION MARK
92                              (make-char 'latin-iso8859-15 #x21)
93                              ;; EURO SIGN
94                              (make-char 'latin-iso8859-15 #x24)))
95      (documentation . "\
96 This is a generic language environment for Latin-9 (ISO-8859-15).  It
97 supports the Euro and the following languages:
98  Danish, Dutch, English, Faeroese, Finnish, French, German, Icelandic,
99  Irish, Italian, Norwegian, Portuguese, Spanish, and Swedish.
100 We also have a German specific language environment \"German\"."))
101    '("European")))
102
103 ;;;###autoload
104 (defun-when-void set-character-of-keysym (keysym character)
105   "Make CHARACTER be inserted when KEYSYM is pressed, 
106 and the key has been bound to `self-insert-command'.  Contrary to the case
107 with `get-character-of-keysym', KEYSYM may only be a symbol, characters are
108 forbidden.  "
109   (check-argument-type 'symbolp keysym) 
110   (check-argument-type 'characterp character)
111   (put keysym 'ascii-character character))
112
113 ;;;###autoload
114 (defun-when-void get-character-of-keysym (keysym)
115   "Return the character inserted when KEYSYM is pressed, 
116 and the key is bound to `self-insert-command'.  "
117   (check-argument-type 'symbolp keysym)
118   (event-to-character (make-event 'key-press (list 'key keysym))))
119
120 ;; #### move these to a separate file for keysyms
121 ;; These are all the ones not in Latin-1.
122
123 ;;;###autoload
124 (flet ((define-keysym-as-char (keysym character)
125          (unless (lookup-key global-map (vector keysym))
126            (define-key global-map (vector keysym) #'self-insert-command))
127          ;; Belt and braces ... 
128          (unless (get-character-of-keysym keysym)
129            (set-character-of-keysym keysym character)))
130        (foo (k o)
131          (define-keysym-as-char k (make-char 'latin-iso8859-15 o))))
132   (foo 'EuroSign   #x24)
133   ;; Don't override these. This code is autoloaded, before the X11 device is
134   ;; available, so what happens is the Latin 2 keysyms are overridden. See
135   ;; http://mid.gmane.org/87ll1xcm3r.fsf@xemacs.org and the associated
136   ;; thread; Hrvoje was correct, I was wrong.
137 ;  (foo 'Scaron     #x26)
138 ;  (foo 'scaron     #x28)
139 ;  (foo 'Zcaron     #x34)
140 ;  (foo 'zcaron     #x38)
141   (foo 'OE         #x3C)
142   (foo 'oe         #x3D)
143   (foo 'Ydiaeresis #x3E))
144
145 (provide 'latin-euro-latin9)
146
147 ;;; end of latin-euro-latin9.el