Subject: 24.4.50; [PATCH] add language environment for the Catalan language

From: Ernest Adrogué <[email-masked]>
Date: Sat, 16 Aug 2014 14:42:45 +0200

This patch adds a language environment for the Catalan language.

It is needed in order to get word motion commands work correctly, as in
Catalan the middle dot character `·' is a word constituent.  This is done by
changing the syntax class of the middle dot character.

Changes made:

        * international/mule-cmds.el (locale-language-names): Map locale
          language name `ca' to language environment `Catalan'.

        * language/european.el: Add definition of language environment for
          the Catalan language.

        * leim/quail/latin-pre.el: Add quail rule to the `catalan-prefix'
          input method to support input of middle dot characters through
          composition.
        
This is a trivial patch based on a post by Dave Love on the help-gnu-emacs
mailing list [1], and therefore I believe a copyright assignment from me is
unnecessary.

[1] http://lists.gnu.org/archive/html/help-gnu-emacs/2009-11/msg00008.html

From e1e7b8a61ac220486ea5b55f95479317f193b8a7 Mon Sep 17 00:00:00 2001
From: nfdisco <[email-masked]>
Date: Sat, 16 Aug 2014 13:06:03 +0200
Subject: [PATCH 1/1] Added Catalan language environment.

---
 lisp/international/mule-cmds.el |  2 +-
 lisp/language/european.el       | 22 ++++++++++++++++++++++
 lisp/leim/quail/latin-pre.el    |  2 ++
 3 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index f6c0719..47e2968 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -2235,7 +2235,7 @@ See `set-language-info-alist' for use in programs."
     ("br" . "Latin-1") ; Breton
     ("bs" . "Latin-2") ; Bosnian
     ("byn" . "UTF-8")  ; Bilin; Blin
-    ("ca" . "Latin-1") ; Catalan
+    ("ca" "Catalan" iso-8859-1) ; Catalan
     ; co Corsican
     ("cs" "Czech" iso-8859-2)
     ("cy" "Welsh" iso-8859-14)
diff --git a/lisp/language/european.el b/lisp/language/european.el
index 96ae232..40ec0b1 100644
--- a/lisp/language/european.el
+++ b/lisp/language/european.el
@@ -614,6 +614,28 @@ method and applying Turkish case rules for the characters i, I, ı, İ.")))
 	    (documentation . "Support for Brazilian Portuguese."))
  '("European"))
 
+(set-language-info-alist
+ "Catalan" '((charset iso-8859-1)
+	     (coding-system iso-8859-1 iso-8859-15)
+	     (coding-priority iso-8859-1)
+	     (input-method . "catalan-prefix")
+	     (nonascii-translation . iso-8859-1)
+	     (unibyte-display . iso-8859-1)
+	     (setup-function
+	      . (lambda ()
+		  (modify-syntax-entry ?· "w" (standard-syntax-table))))
+	     (exit-function
+	      . (lambda ()
+		  (modify-syntax-entry ?· "_" (standard-syntax-table))))
+	     (sample-text . "\
+Catalan (Català)  Avui demà i ahir s'esfullarà una rosa.")
+	     (documentation . "\
+This language environment uses the ISO-8859-1 character set,
+sets the default input method to \"catalan-prefix\", and sets
+the syntax of the middle dot character `·' to word."))
+  '("European"))
+
+
 
 (define-coding-system 'mac-roman
   "Mac Roman Encoding (MIME:MACINTOSH)."
diff --git a/lisp/leim/quail/latin-pre.el b/lisp/leim/quail/latin-pre.el
index 6202b89..03de5f2 100644
--- a/lisp/leim/quail/latin-pre.el
+++ b/lisp/leim/quail/latin-pre.el
@@ -188,6 +188,7 @@
   diaeresis  |   \"    | \"i -> ï   \"\" -> ¨
     tilde    |   ~    | ~n -> ñ
    cedilla   |   ~    | ~c -> ç
+  middle dot |   ~    | ~. -> ·
    symbol    |   ~    | ~> -> »   ~< -> «   ~! -> ¡   ~? -> ¿
 " nil t nil nil nil nil nil nil nil nil t)
 
@@ -223,6 +224,7 @@
  ("~<" ?\«)
  ("~!" ?¡)
  ("~?" ?¿)
+ ("~." ?·)
  ("~ " ?~)
 )
 
-- 
2.0.1