diff options
| author | Juri Linkov | 2009-08-31 00:28:11 +0000 |
|---|---|---|
| committer | Juri Linkov | 2009-08-31 00:28:11 +0000 |
| commit | ab96f28bbb4f0d5614eb7e897a15b8c79e474b58 (patch) | |
| tree | 72d8951323efddcb846d4aa63470a8ab08c9cfff | |
| parent | 4cf71456ff19c8044cc98193acf4f7fac4258a33 (diff) | |
| download | emacs-ab96f28bbb4f0d5614eb7e897a15b8c79e474b58.tar.gz emacs-ab96f28bbb4f0d5614eb7e897a15b8c79e474b58.zip | |
("ipa-kirshenbaum"): Rename from "kirshenbaum-ipa".
("ipa-x-sampa"): Rename from "x-sampa-ipa".
(ipa-x-sampa-implosive-submap): Rename from
x-sampa-implosive-submap.
(ipa-x-sampa-prepend-to-keymap-entry): Rename from
x-sampa-prepend-to-keymap-entry.
(ipa-x-sampa-underscore-implosive): Rename from
x-sampa-underscore-implosive.
(ipa-x-sampa-implosive-submap): Move before first use.
| -rw-r--r-- | leim/ChangeLog | 12 | ||||
| -rw-r--r-- | leim/quail/ipa.el | 45 |
2 files changed, 35 insertions, 22 deletions
diff --git a/leim/ChangeLog b/leim/ChangeLog index 5451ce3371d..3f60cb7d81e 100644 --- a/leim/ChangeLog +++ b/leim/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2009-08-31 Juri Linkov <juri@jurta.org> | ||
| 2 | |||
| 3 | * quail/ipa.el ("ipa-kirshenbaum"): Rename from "kirshenbaum-ipa". | ||
| 4 | ("ipa-x-sampa"): Rename from "x-sampa-ipa". | ||
| 5 | (ipa-x-sampa-implosive-submap): Rename from | ||
| 6 | x-sampa-implosive-submap. | ||
| 7 | (ipa-x-sampa-prepend-to-keymap-entry): Rename from | ||
| 8 | x-sampa-prepend-to-keymap-entry. | ||
| 9 | (ipa-x-sampa-underscore-implosive): Rename from | ||
| 10 | x-sampa-underscore-implosive. | ||
| 11 | (ipa-x-sampa-implosive-submap): Move before first use. | ||
| 12 | |||
| 1 | 2009-08-30 Aidan Kehoe <kehoea@parhasard.net> | 13 | 2009-08-30 Aidan Kehoe <kehoea@parhasard.net> |
| 2 | 14 | ||
| 3 | * quail/ipa.el ("kirshenbaum-ipa", "x-sampa-ipa"): | 15 | * quail/ipa.el ("kirshenbaum-ipa", "x-sampa-ipa"): |
diff --git a/leim/quail/ipa.el b/leim/quail/ipa.el index 9b6a3193918..e72b8976cce 100644 --- a/leim/quail/ipa.el +++ b/leim/quail/ipa.el | |||
| @@ -112,7 +112,7 @@ Upside-down characters are obtained by a preceding slash (/)." | |||
| 112 | (":" ?ː)) | 112 | (":" ?ː)) |
| 113 | 113 | ||
| 114 | (quail-define-package | 114 | (quail-define-package |
| 115 | "kirshenbaum-ipa" "IPA" "IPA-K" t | 115 | "ipa-kirshenbaum" "IPA" "IPA-K" t |
| 116 | "The International Phonetic Alphabet, using Kirshenbaum ASCII translit. | 116 | "The International Phonetic Alphabet, using Kirshenbaum ASCII translit. |
| 117 | 117 | ||
| 118 | Kirshenbaum IPA is an ASCII transliteration of the phonetic alphabet, common | 118 | Kirshenbaum IPA is an ASCII transliteration of the phonetic alphabet, common |
| @@ -241,6 +241,19 @@ incorrectly, as separate from the modified glyphs.") | |||
| 241 | ("o-" "ɤ") ;; Upper-mid back unrounded vowel U+0264 | 241 | ("o-" "ɤ") ;; Upper-mid back unrounded vowel U+0264 |
| 242 | ("A." "ɒ")) ;; Lower back rounded vowel U+0252 | 242 | ("A." "ɒ")) ;; Lower back rounded vowel U+0252 |
| 243 | 243 | ||
| 244 | |||
| 245 | (defconst ipa-x-sampa-implosive-submap | ||
| 246 | '(("b_<" ?ɓ) ;; Voiced bilabial implosive U+0253 | ||
| 247 | ("d_<" ?ɗ) ;; Voiced alveolar implosive U+0257 | ||
| 248 | ("g_<" ?ɠ) ;; Voiced velar implosive U+0260 | ||
| 249 | ("G\\_<" ?ʛ) ;; Voiced uvular implosive U+029B | ||
| 250 | ("J\\_<" ?ʄ)) ;; Voiced palatal implosive U+0284 | ||
| 251 | "A map from the X-SAMPA for some implosive consonants to characters. | ||
| 252 | This is used because their X-SAMPA syntax is quasi-diacritic, but the | ||
| 253 | corresponding Unicode characters themselves don't have diacritics, they are | ||
| 254 | separate code points. So we need to implement some extra logic that isn't | ||
| 255 | normally provided by Quail.") | ||
| 256 | |||
| 244 | ;; On XEmacs, with the supplied X-SAMPA data, this function is capably | 257 | ;; On XEmacs, with the supplied X-SAMPA data, this function is capably |
| 245 | ;; implemented with: | 258 | ;; implemented with: |
| 246 | ;; | 259 | ;; |
| @@ -248,7 +261,7 @@ incorrectly, as separate from the modified glyphs.") | |||
| 248 | ;; | 261 | ;; |
| 249 | ;; Supporting GNU Emacs too makes it a good deal more complicated. | 262 | ;; Supporting GNU Emacs too makes it a good deal more complicated. |
| 250 | 263 | ||
| 251 | (defun x-sampa-prepend-to-keymap-entry (to-prepend quail-keymap) | 264 | (defun ipa-x-sampa-prepend-to-keymap-entry (to-prepend quail-keymap) |
| 252 | "Return QUAIL-KEYMAP with TO-PREPEND at the beginning of each result. | 265 | "Return QUAIL-KEYMAP with TO-PREPEND at the beginning of each result. |
| 253 | 266 | ||
| 254 | QUAIL-KEYMAP is a cons that satisfies `quail-map-p'; TO-PREPEND is a | 267 | QUAIL-KEYMAP is a cons that satisfies `quail-map-p'; TO-PREPEND is a |
| @@ -270,7 +283,7 @@ string." | |||
| 270 | (if (integerp entry) (string entry) entry))) | 283 | (if (integerp entry) (string entry) entry))) |
| 271 | quail-keymap)))) | 284 | quail-keymap)))) |
| 272 | 285 | ||
| 273 | (defun x-sampa-underscore-implosive (input-string length) | 286 | (defun ipa-x-sampa-underscore-implosive (input-string length) |
| 274 | "Return keymap with IPA implosives, for INPUT-STRING, length LENGTH. | 287 | "Return keymap with IPA implosives, for INPUT-STRING, length LENGTH. |
| 275 | 288 | ||
| 276 | The implosive consonants in X-SAMPA are represented with more or less a | 289 | The implosive consonants in X-SAMPA are represented with more or less a |
| @@ -290,7 +303,7 @@ particular sequence of keys, and the result will be cached by Quail." | |||
| 290 | (pre-underscore (car split-input)) | 303 | (pre-underscore (car split-input)) |
| 291 | (pre-underscore-map (quail-lookup-key pre-underscore)) | 304 | (pre-underscore-map (quail-lookup-key pre-underscore)) |
| 292 | (x-sampa-submap-entry | 305 | (x-sampa-submap-entry |
| 293 | (assoc (format "%s<" input-string) x-sampa-implosive-submap)) | 306 | (assoc (format "%s<" input-string) ipa-x-sampa-implosive-submap)) |
| 294 | underscore-map-entry) | 307 | underscore-map-entry) |
| 295 | (if (and (consp pre-underscore-map) (car pre-underscore-map)) | 308 | (if (and (consp pre-underscore-map) (car pre-underscore-map)) |
| 296 | (setq pre-underscore-map (car pre-underscore-map)) | 309 | (setq pre-underscore-map (car pre-underscore-map)) |
| @@ -301,12 +314,12 @@ particular sequence of keys, and the result will be cached by Quail." | |||
| 301 | (cond ((null underscoring)) | 314 | (cond ((null underscoring)) |
| 302 | ((eq (length underscoring) 2) | 315 | ((eq (length underscoring) 2) |
| 303 | (setq underscore-map-entry (second underscoring)) | 316 | (setq underscore-map-entry (second underscoring)) |
| 304 | (setcdr underscoring (x-sampa-prepend-to-keymap-entry | 317 | (setcdr underscoring (ipa-x-sampa-prepend-to-keymap-entry |
| 305 | pre-underscore-map underscore-map-entry))) | 318 | pre-underscore-map underscore-map-entry))) |
| 306 | ((eq (length underscoring) 3) | 319 | ((eq (length underscoring) 3) |
| 307 | (setq underscore-map-entry (second (third underscoring))) | 320 | (setq underscore-map-entry (second (third underscoring))) |
| 308 | (setcdr (third underscoring) | 321 | (setcdr (third underscoring) |
| 309 | (x-sampa-prepend-to-keymap-entry | 322 | (ipa-x-sampa-prepend-to-keymap-entry |
| 310 | pre-underscore-map underscore-map-entry))) | 323 | pre-underscore-map underscore-map-entry))) |
| 311 | (t | 324 | (t |
| 312 | (assert (null t) t | 325 | (assert (null t) t |
| @@ -314,7 +327,7 @@ particular sequence of keys, and the result will be cached by Quail." | |||
| 314 | (append underscore-map (list (list ?< (second x-sampa-submap-entry)))))) | 327 | (append underscore-map (list (list ?< (second x-sampa-submap-entry)))))) |
| 315 | 328 | ||
| 316 | (quail-define-package | 329 | (quail-define-package |
| 317 | "x-sampa-ipa" "IPA" "IPA-X" t | 330 | "ipa-x-sampa" "IPA" "IPA-X" t |
| 318 | "The International Phonetic Alphabet, using J.C. Wells' X-SAMPA. | 331 | "The International Phonetic Alphabet, using J.C. Wells' X-SAMPA. |
| 319 | 332 | ||
| 320 | X-SAMPA is an ASCII transliteration of the IPA, normally used for data | 333 | X-SAMPA is an ASCII transliteration of the IPA, normally used for data |
| @@ -488,28 +501,16 @@ displays them, incorrectly, as separate from the modified glyphs." nil t t) | |||
| 488 | ("_X" "̆") ;; Extra-short U+0306 | 501 | ("_X" "̆") ;; Extra-short U+0306 |
| 489 | ("_x" "̽")) ;; Mid-centralised U+033D | 502 | ("_x" "̽")) ;; Mid-centralised U+033D |
| 490 | 503 | ||
| 491 | (defconst x-sampa-implosive-submap | ||
| 492 | '(("b_<" ?ɓ) ;; Voiced bilabial implosive U+0253 | ||
| 493 | ("d_<" ?ɗ) ;; Voiced alveolar implosive U+0257 | ||
| 494 | ("g_<" ?ɠ) ;; Voiced velar implosive U+0260 | ||
| 495 | ("G\\_<" ?ʛ) ;; Voiced uvular implosive U+029B | ||
| 496 | ("J\\_<" ?ʄ)) ;; Voiced palatal implosive U+0284 | ||
| 497 | "A map from the X-SAMPA for some implosive consonants to characters. | ||
| 498 | This is used because their X-SAMPA syntax is quasi-diacritic, but the | ||
| 499 | corresponding Unicode characters themselves don't have diacritics, they are | ||
| 500 | separate code points. So we need to implement some extra logic that isn't | ||
| 501 | normally provided by Quail.") | ||
| 502 | |||
| 503 | ;; Putting in place rules for the implosives like for the others above | 504 | ;; Putting in place rules for the implosives like for the others above |
| 504 | ;; breaks the "_<diacritic>" rules for b, d, g, G and J a little--you need | 505 | ;; breaks the "_<diacritic>" rules for b, d, g, G and J a little--you need |
| 505 | ;; to interrupt Quail before typing the underscore if you want the | 506 | ;; to interrupt Quail before typing the underscore if you want the |
| 506 | ;; diacritic. To avoid this, handle the input specially with the function | 507 | ;; diacritic. To avoid this, handle the input specially with the function |
| 507 | ;; x-sampa-underscore-implosive. | 508 | ;; ipa-x-sampa-underscore-implosive. |
| 508 | 509 | ||
| 509 | (dolist (implosive-x-sampa (mapcar 'car x-sampa-implosive-submap)) | 510 | (dolist (implosive-x-sampa (mapcar 'car ipa-x-sampa-implosive-submap)) |
| 510 | (setq implosive-x-sampa (car (split-string implosive-x-sampa "_"))) | 511 | (setq implosive-x-sampa (car (split-string implosive-x-sampa "_"))) |
| 511 | (quail-defrule (format "%s_" implosive-x-sampa) | 512 | (quail-defrule (format "%s_" implosive-x-sampa) |
| 512 | 'x-sampa-underscore-implosive)) | 513 | 'ipa-x-sampa-underscore-implosive)) |
| 513 | 514 | ||
| 514 | ;; arch-tag: cf2614cc-ecce-4ef5-ba51-37faeed41691 | 515 | ;; arch-tag: cf2614cc-ecce-4ef5-ba51-37faeed41691 |
| 515 | ;;; ipa.el ends here | 516 | ;;; ipa.el ends here |