maori-input-method.el (3205B)
1 ;;; maori-input-method.el --- Māori input method for Emacs -*- lexical-binding: t; -*- 2 3 ;; Copyright (C) 2020 Jamie Beardslee 4 5 ;; Author: Jamie Beardslee <jdb@jamzattack.xyz> 6 ;; Version: 2020.09.18 7 ;; Keywords: i18n 8 9 ;; This program is free software; you can redistribute it and/or modify 10 ;; it under the terms of the GNU General Public License as published by 11 ;; the Free Software Foundation, either version 3 of the License, or 12 ;; (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, see <https://www.gnu.org/licenses/>. 21 22 ;;; Commentary: 23 24 ;; This library defines two simple input methods: `maori-prefix' and 25 ;; `maori-postfix'. They provide a way to insert Māori macrons atop 26 ;; vowels by either using a hyphen or doubling the vowel. To get a 27 ;; literal hyphen or vowel, double it. 28 ;; 29 ;; For example, using `maori-postfix': 30 ;; a -> a 31 ;; aa -> ā 32 ;; a- -> ā 33 ;; aaa -> aa 34 ;; a-- -> a- 35 36 ;;; Code: 37 38 (quail-define-package 39 "maori-prefix" "Māori" "MA>" t 40 "Māori input method with postfix modifiers 41 42 A prefixed - or doubled letter will produce an accented 43 character, e.g. aa -> ā oo -> ō -o -> ō. 44 45 Tripling the letter inserts two letters, and -- inserts a real 46 dash, e.g. aaa -> aa --e -> -e. 47 " nil t nil nil nil nil nil nil nil nil t) 48 49 (quail-define-rules 50 ("aa" ?\ā) 51 ("AA" ?\Ā) 52 ("ee" ?\ē) 53 ("EE" ?\Ē) 54 ("ii" ?\ī) 55 ("II" ?\Ī) 56 ("oo" ?\ō) 57 ("OO" ?\Ō) 58 ("uu" ?\ū) 59 ("UU" ?\Ū) 60 61 ("-a" ?\ā) 62 ("-A" ?\Ā) 63 ("-e" ?\ē) 64 ("-E" ?\Ē) 65 ("-i" ?\ī) 66 ("-I" ?\Ī) 67 ("-o" ?\ō) 68 ("-O" ?\Ō) 69 ("-u" ?\ū) 70 ("-U" ?\Ū) 71 72 ("aaa" ["aa"]) 73 ("AAA" ["Aa"]) 74 ("eee" ["ee"]) 75 ("EEE" ["EE"]) 76 ("iii" ["ii"]) 77 ("III" ["II"]) 78 ("ooo" ["oo"]) 79 ("OOO" ["OO"]) 80 ("uuu" ["uu"]) 81 ("UUU" ["UU"]) 82 83 ("--a" ["-a"]) 84 ("--A" ["-A"]) 85 ("--e" ["-e"]) 86 ("--E" ["-E"]) 87 ("--i" ["-i"]) 88 ("--I" ["-I"]) 89 ("--o" ["-o"]) 90 ("--O" ["-O"]) 91 ("--u" ["-u"]) 92 ("--U" ["-U"])) 93 94 (quail-define-package 95 "maori-postfix" "Māori" "MA<" t 96 "Māori input method with postfix modifiers 97 98 A following - or doubled letter will produce an accented 99 character, e.g. aa -> ā oo -> ō o- -> ō. 100 101 Tripling the letter inserts two letters, and -- inserts a real 102 dash, e.g. aaa -> aa e-- -> e-. 103 " nil t nil nil nil nil nil nil nil nil t) 104 105 (quail-define-rules 106 ("aa" ?\ā) 107 ("AA" ?\Ā) 108 ("ee" ?\ē) 109 ("EE" ?\Ē) 110 ("ii" ?\ī) 111 ("II" ?\Ī) 112 ("oo" ?\ō) 113 ("OO" ?\Ō) 114 ("uu" ?\ū) 115 ("UU" ?\Ū) 116 117 ("a-" ?\ā) 118 ("A-" ?\Ā) 119 ("e-" ?\ē) 120 ("E-" ?\Ē) 121 ("i-" ?\ī) 122 ("I-" ?\Ī) 123 ("o-" ?\ō) 124 ("O-" ?\Ō) 125 ("u-" ?\ū) 126 ("U-" ?\Ū) 127 128 ("aaa" ["aa"]) 129 ("AAA" ["Aa"]) 130 ("eee" ["ee"]) 131 ("EEE" ["EE"]) 132 ("iii" ["ii"]) 133 ("III" ["II"]) 134 ("ooo" ["oo"]) 135 ("OOO" ["OO"]) 136 ("uuu" ["uu"]) 137 ("UUU" ["UU"]) 138 139 ("a--" ["a-"]) 140 ("A--" ["A-"]) 141 ("e--" ["e-"]) 142 ("E--" ["E-"]) 143 ("i--" ["i-"]) 144 ("I--" ["I-"]) 145 ("o--" ["o-"]) 146 ("O--" ["O-"]) 147 ("u--" ["u-"]) 148 ("U--" ["U-"])) 149 150 151 (provide 'maori-input-method) 152 ;;; maori-input-method.el ends here