[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Ogham input method
From: |
David De La Harpe Golden |
Subject: |
Re: Ogham input method |
Date: |
Thu, 29 May 2008 13:45:01 +0100 |
User-agent: |
Mozilla-Thunderbird 2.0.0.14 (X11/20080509) |
David De La Harpe Golden wrote:
>
> Heh, my bad, there's a standard (I.S. 434:1999) keyboard layout for
> ogham that is included with X,
Okay, attached is ogham.el v2
This version's "ogham" input method should act as something "close
enough" to IS434.
;;; ogham.el --- Quail method for Ogham alphabet -*- coding: utf-8 -*-
;; Copyright (C) 2008
;; David De La Harpe Golden
;; Author: David De La Harpe Golden <address@hidden>
;; Keywords: i18n
;; ogham.el is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; ogham.el is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with ogham.el. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; Ogham, old irish alphabet, now in unicode.
;; Version 2 - now with I.S. 434:1999-like method.
;;; Code:
(require 'quail)
(defun ogham-insert-space ()
"Insert an ascii or ogham space.
If point is preceded by an ogham character other than an
ogham ending (reversed) feather mark (like -<), then insert
an ogham space mark, otherwise insert an ascii space."
(interactive)
(cond
((memq (preceding-char)
'(?á ?á ?á ?á ?á ?á
?á ?á ?á ?á ?á
?á ?á ?á ?á ?á ?á ?á ?á ?á ?á
?á ?á ?á ?á ?á ?á ?á)) ;; excludes this: ?á
(insert ?á))
(t
(insert #x20))))
(defun ogham-activate-ogham-space ()
(when (string-equal (car quail-current-package) "ogham-manu")
(local-set-key " " 'ogham-insert-space)))
(defun ogham-inactivate-ogham-space ()
(when (string-equal (car quail-current-package) "ogham-manu")
(local-unset-key " ")))
;; called at end of this file
(defun ogham-install-quail-hooks ()
"Installs quail hooks for smart ogham space handling."
(interactive)
(add-hook 'quail-activate-hook 'ogham-activate-ogham-space)
(add-hook 'quail-inactivate-hook 'ogham-inactivate-ogham-space))
(defun ogham-remove-quail-hooks ()
"Removes quail hooks for smart ogham space handling."
(interactive)
(remove-hook 'quail-activate-hook 'ogham-activate-ogham-space)
(remove-hook 'quail-inactivate-hook 'ogham-inactivate-ogham-space))
(quail-define-package
"ogham" "Irish"
"ááá"
t
"Ogham alphabet input method with I.S.434:1999-like keyboard layout.
Also supports >/< for ááá, similar to the ie(ogam) xkb
keymap for X.org.
It is assumed rather than the IS434 ogham shift-lock,
you toggle this input method on and off with C-\
Warning: If your ogham font is in a `stemless' ogham style,
the ogham space mark may, logically enough, appear as a blank
character similar to ascii space, rather than as a dash-like
character.
"
nil t nil nil nil nil nil nil nil nil t)
(quail-define-rules
("/" ?á)
("?" ?á)
("#" ?á)
("~" ?á)
("b" ?á)
("l" ?á)
("f" ?á)
("s" ?á)
("n" ?á
)
("h" ?á)
("d" ?á)
("t" ?á)
("c" ?á)
("q" ?á)
("m" ?á)
("g" ?á)
("v" ?á)
("z" ?á)
("r" ?á)
("a" ?á)
("o" ?á)
("u" ?á)
("e" ?á)
("i" ?á)
("w" ?á)
("k" ?á)
("j" ?á)
("y" ?á)
("x" ?á)
("p" ?á)
("\\" ?á)
(">" ?á)
("." ?á)
("|" ?á)
("`" ?á)
("¬" ?á)
("<" ?á)
("," ?á)
)
(quail-define-package
"ogham-manu" "Irish"
"ááá"
t
"Ogham alphabet input method by latin transcriptions, with context space.
This input method uses the transcriptions of the ogham
alphabet to latin in the late/manuscript tradition i.e.
you enter nGeadal as ng and the Forfeda as dipthongs:
ááááááááááá
áá >-b-l-f-s-n-<
ááááááááááááá >-h-d-t-c-q-<
ááááááááááááá >-m-g-ng-z-r-<
ááááááááááááá >-a-o-u-e-i-<
ááááááááááááá >-ea-oi-ui-ia-ae-<
ááááá >-p-<
á > or ,
á < or .
á - or / or ? or (sometimes) SPC (see below).
SPC keypresses are handled specially:
SPC will insert an ogham space mark (`á') when preceded by an
ogham character other than an ogham ending (reversed) feather
mark (`á'), otherise it will insert an ascii space (` ').
Warning: If your ogham font is in a `stemless' ogham style,
the ogham space mark may, logically enough, appear as a blank
character similar to ascii space, rather than as a dash-like
character.
"
nil t nil nil nil nil nil nil nil nil t)
;; helper to generate template to be filled in
;; (dotimes (i #x1d)
;; (insert "(\"\" ?")
;; (insert-char (+ i #x1680) 1)
;; (insert ")\n"))
(quail-define-rules
("-" ?á)
("/" ?á)
("?" ?á)
("b" ?á)
("l" ?á)
("f" ?á)
("s" ?á)
("n" ?á
)
("h" ?á)
("d" ?á)
("t" ?á)
("c" ?á)
("q" ?á)
("m" ?á)
("g" ?á)
("ng" ?á)
("z" ?á)
("r" ?á)
("a" ?á)
("o" ?á)
("u" ?á)
("e" ?á)
("i" ?á)
("ea" ?á)
("oi" ?á)
("ui" ?á)
("ia" ?á)
("ae" ?á)
("p" ?á)
(">" ?á)
("." ?á)
("<" ?á)
("," ?á)
)
(ogham-install-quail-hooks)
(provide 'ogham)
;;; ogham.el ends here