Function: ipa-x-sampa-underscore-implosive
ipa-x-sampa-underscore-implosive is a byte-compiled function defined
in ipa.el.gz.
Signature
(ipa-x-sampa-underscore-implosive INPUT-STRING LENGTH)
Documentation
Return keymap with IPA implosives, for INPUT-STRING, length LENGTH.
The implosive consonants in X-SAMPA are represented with more or less a
diacritic syntax, but the property +implosive in the IPA is expressed using
separate characters, and not using a diacritic. This function works around
the confusion that implies when generating IPA from X-SAMPA; it returns a
Quail map that is a copy of the map for _, but with all the DIACRITIC
entries changed to return the diacritic together with the base character,
and with the map to the implosive added to its end.
Like all quail-defrule-assigned functions, this will be called once for
each particular sequence of keys, the first time the user types that
particular sequence of keys, and the result will be cached by Quail.
Source Code
;; Defined in /usr/src/emacs/lisp/leim/quail/ipa.el.gz
(defun ipa-x-sampa-underscore-implosive (input-string length)
"Return keymap with IPA implosives, for INPUT-STRING, length LENGTH.
The implosive consonants in X-SAMPA are represented with more or less a
diacritic syntax, but the property +implosive in the IPA is expressed using
separate characters, and not using a diacritic. This function works around
the confusion that implies when generating IPA from X-SAMPA; it returns a
Quail map that is a copy of the map for `_', but with all the DIACRITIC
entries changed to return the diacritic together with the base character,
and with the map to the implosive added to its end.
Like all `quail-defrule'-assigned functions, this will be called once for
each particular sequence of keys, the first time the user types that
particular sequence of keys, and the result will be cached by Quail."
(let* ((input-string (substring input-string 0 (or length)))
(underscore-map (copy-tree (quail-lookup-key "_")))
(split-input (split-string input-string "_"))
(pre-underscore (car split-input))
(pre-underscore-map (quail-lookup-key pre-underscore))
(x-sampa-submap-entry
(assoc (format "%s<" input-string) ipa-x-sampa-implosive-submap))
underscore-map-entry)
(if (and (consp pre-underscore-map) (car pre-underscore-map))
(setq pre-underscore-map (car pre-underscore-map))
(setq pre-underscore-map pre-underscore))
(unless (stringp pre-underscore-map)
(setq pre-underscore-map (string pre-underscore-map)))
(dolist (underscoring underscore-map)
(cond ((null underscoring))
((eq (length underscoring) 2)
(setq underscore-map-entry (cl-second underscoring))
(setcdr underscoring (ipa-x-sampa-prepend-to-keymap-entry
pre-underscore-map underscore-map-entry)))
((eq (length underscoring) 3)
(setq underscore-map-entry (cl-second (cl-third underscoring)))
(setcdr (cl-third underscoring)
(ipa-x-sampa-prepend-to-keymap-entry
pre-underscore-map underscore-map-entry)))
(t
(cl-assert (null t) t
"Can't handle subtrees of this level right now."))))
(append underscore-map (list (list ?< (cl-second x-sampa-submap-entry))))))