unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Ogham input method
@ 2008-05-29  8:42 David De La Harpe Golden
  2008-05-29  9:52 ` David De La Harpe Golden
  0 siblings, 1 reply; 3+ messages in thread
From: David De La Harpe Golden @ 2008-05-29  8:42 UTC (permalink / raw)
  To: emacs developers

[-- Attachment #1: Type: text/plain, Size: 628 bytes --]

Ogham is an old irish alphabet that is in unicode
http://en.wikipedia.org/wiki/Ogham
http://www.omniglot.com/writing/ogham.htm

Not exactly a complicated input method or alphabet, nor particularly
vital to support (modern irish is usually written in latin alphabet),
but turned out to be easy to do.

The "smart" ogham vs. ascii space handling (ethiopic does something
conceptually similar but more complicated) is probably wrongly
implemented (though it works for me), but it's nonessential anyway
("-" is also mapped to ogham space, so it might be okay to leave space
alone rather than trying the "smart" space thing).








[-- Attachment #2: ogham.el --]
[-- Type: text/plain, Size: 3832 bytes --]

;;; ogham.el --- Quail method for Ogham alphabet -*- coding: utf-8 -*-

;; Copyright (C) 2008
;;   David De La Harpe Golden

;; Author: David De La Harpe Golden <david@harpegolden.net>
;; 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.

;;; 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")
    (local-set-key " " 'ogham-insert-space)))

(defun ogham-inactivate-ogham-space ()
  (when (string-equal (car quail-current-package) "ogham")
    (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 (old Irish alphabet) input method (see Latin methods for modern Irish)

Forfeda input as dipthongs (late/manuscript ogham).

᚛ ᚁ ᚂ ᚃ ᚄ ᚅ ᚜  >-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 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Ogham input method
  2008-05-29  8:42 Ogham input method David De La Harpe Golden
@ 2008-05-29  9:52 ` David De La Harpe Golden
  2008-05-29 12:45   ` David De La Harpe Golden
  0 siblings, 1 reply; 3+ messages in thread
From: David De La Harpe Golden @ 2008-05-29  9:52 UTC (permalink / raw)
  To: emacs developers

David De La Harpe Golden wrote:
> Ogham is an old irish alphabet that is in unicode
> http://en.wikipedia.org/wiki/Ogham
> http://www.omniglot.com/writing/ogham.htm
> 
> Not exactly a complicated input method or alphabet, nor particularly
> vital to support (modern irish is usually written in latin alphabet),
> but turned out to be easy to do.

Heh, my bad, there's a standard (I.S. 434:1999) keyboard layout for
ogham that is included with X, so that was easy... and relatively
pointless.  Version I sent doesn't 100% follow the standard (because
mine was a transliteration...).    Was a learning exercise anyway.

Probably could/should do a more nearly standard-conforming quail one
once I understand the quail keyboard layout stuff.












^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Ogham input method
  2008-05-29  9:52 ` David De La Harpe Golden
@ 2008-05-29 12:45   ` David De La Harpe Golden
  0 siblings, 0 replies; 3+ messages in thread
From: David De La Harpe Golden @ 2008-05-29 12:45 UTC (permalink / raw)
  To: emacs developers

[-- Attachment #1: Type: text/plain, Size: 258 bytes --]

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.




[-- Attachment #2: ogham.el --]
[-- Type: text/plain, Size: 5115 bytes --]

;;; ogham.el --- Quail method for Ogham alphabet -*- coding: utf-8 -*-

;; Copyright (C) 2008
;;   David De La Harpe Golden

;; Author: David De La Harpe Golden <david@harpegolden.net>
;; 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-05-29 12:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-29  8:42 Ogham input method David De La Harpe Golden
2008-05-29  9:52 ` David De La Harpe Golden
2008-05-29 12:45   ` David De La Harpe Golden

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).