1 ;;; latin-euro-latin9.el --- Define language environment
3 ;; Copyright (C) 2002, 2003 Free Software Foundation, Inc
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
10 ;; This file is part of XEmacs.
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)
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.
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.
30 ;; Provides the latin-9 language environment, character set and coding
35 ;; define ISO-8859-15 for XEmacs 21.4 and earlier
38 (unless (find-charset 'latin-iso8859-15)
39 ;; Create character set
41 'latin-iso8859-15 "ISO8859-15 (Latin 9)"
42 '(short-name "Latin-9"
43 long-name "ISO8859-15 (Latin 9)"
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
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.
65 'iso-8859-15 'iso2022 "MIME ISO-8859-15"
67 charset-g1 latin-iso8859-15
70 mnemonic "MIME/Ltn-9")))
73 (unless (assoc "Latin-9" language-info-alist)
74 (defun setup-latin9-environment ()
75 "Set up multilingual environment (MULE) for European Latin-9 users."
77 (set-language-environment "Latin-9"))
79 (set-language-info-alist
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)
90 (make-char 'latin-iso8859-15 #x5F)
91 ;; INVERTED EXCLAMATION MARK
92 (make-char 'latin-iso8859-15 #x21)
94 (make-char 'latin-iso8859-15 #x24)))
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\"."))
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
109 (check-argument-type 'symbolp keysym)
110 (check-argument-type 'characterp character)
111 (put keysym 'ascii-character character))
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))))
120 ;; #### move these to a separate file for keysyms
121 ;; These are all the ones not in Latin-1.
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)))
131 (define-keysym-as-char k (make-char 'latin-iso8859-15 o))))
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.
143 (foo 'Ydiaeresis #x3E))
145 (provide 'latin-euro-latin9)
147 ;;; end of latin-euro-latin9.el