Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Input method for Tifinagh, the script where Tamazight, also known as …

…Berber Language, can be written in.
  • Loading branch information...
commit c319257824f2e4b00989324a54a3abf3bb98fb1c 1 parent aa52f87
niels giesen authored

Showing 1 changed file with 65 additions and 0 deletions. Show diff stats Hide diff stats

  1. +65 0 tifinagh.el
65 tifinagh.el
... ... @@ -0,0 +1,65 @@
  1 +;;; tifinagh.el --- Quail package for inputting Tifinagh characters -*-coding: utf-8; -*-
  2 +
  3 +;; Copyright (C) 2011 Niels Giesen
  4 +
  5 +;; Author: Niels Giesen <com dot gmail at niels dot giesen, in reversed order>
  6 +;; Keywords: mule, input method, tifinagh, tamazight, berber
  7 +;; Version: 1.0
  8 +
  9 +;; This program is free software; you can redistribute it and/or
  10 +;; modify it under the terms of the GNU General Public License
  11 +;; as published by the Free Software Foundation; either version 3
  12 +;; of the License, or (at your option) any later version.
  13 +
  14 +;; This program is distributed in the hope that it will be useful,
  15 +;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  16 +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17 +;; GNU General Public License for more details.
  18 +
  19 +;; You should have received a copy of the GNU General Public License
  20 +;; along with this program; if not, write to the Free Software
  21 +;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  22 +;; 02110-1301, USA.
  23 +
  24 +(require 'quail)
  25 +
  26 +(quail-define-package
  27 + "tifinagh" "Tifinagh" "Tif" t
  28 + "Tifinagh input method."
  29 + nil t nil nil nil nil nil nil nil nil t)
  30 +
  31 +(flet ((range (from to)
  32 + (let (list)
  33 + (dotimes (l (- (1+ to) from) (nreverse list))
  34 + (push (+ from l) list)))))
  35 + (let* ((letters (range 11568 11621))
  36 + (rules
  37 + (mapcar
  38 + (lambda (char)
  39 + (let ((input (car
  40 + (nreverse
  41 + (split-string
  42 + (downcase (get-char-code-property char 'name))
  43 + " ")))))
  44 + (setq input
  45 + (cond ((string= input "ya") "a")
  46 + ((string= input "yey") "e")
  47 + ((string= input "yagn") "ny")
  48 + ((/= (aref input 1)
  49 + ?a) (substring input 1))
  50 + (t (substring input 2))))
  51 +
  52 + (list input char)))
  53 + letters)))
  54 +
  55 + ;;append two extra rules
  56 + (setq rules
  57 + (append
  58 + '(("ch" ["ⵜⵛ"])
  59 + ("_" "ⵯ"))
  60 + rules))
  61 +
  62 + (eval `(quail-define-rules ,@rules))))
  63 +
  64 +(provide 'tifinagh)
  65 +;; tifinagh.el ends here

0 comments on commit c319257

Please sign in to comment.
Something went wrong with that request. Please try again.