Function: ipa-x-sampa-prepend-to-keymap-entry

ipa-x-sampa-prepend-to-keymap-entry is a byte-compiled function defined in ipa.el.gz.

Signature

(ipa-x-sampa-prepend-to-keymap-entry TO-PREPEND QUAIL-KEYMAP)

Documentation

Return QUAIL-KEYMAP with TO-PREPEND at the beginning of each result.

QUAIL-KEYMAP is a cons that satisfies quail-map-p; TO-PREPEND is a string.

Source Code

;; Defined in /usr/src/emacs/lisp/leim/quail/ipa.el.gz
;; On XEmacs, with the supplied X-SAMPA data, this function is capably
;; implemented with:
;;
;;   (list (vector (concat to-prepend quail-keymap)))
;;
;; Supporting GNU Emacs too makes it a good deal more complicated.

(defun ipa-x-sampa-prepend-to-keymap-entry (to-prepend quail-keymap)
  "Return QUAIL-KEYMAP with TO-PREPEND at the beginning of each result.

QUAIL-KEYMAP is a cons that satisfies `quail-map-p'; TO-PREPEND is a
string."
  (when (consp quail-keymap) (setq quail-keymap (cdr quail-keymap)))
  (if (or (integerp quail-keymap)
          (characterp quail-keymap))
      (setq quail-keymap (list (string quail-keymap)))
    (if (stringp quail-keymap)
	(setq quail-keymap (list quail-keymap))
      (cl-assert (vectorp quail-keymap) t)
      (setq quail-keymap (append quail-keymap nil))))
  (list
   (apply #'vector
	  (mapcar
           (lambda (entry)
             (cl-assert (char-or-string-p entry) t)
             (format "%s%s" to-prepend
                     (if (integerp entry) (string entry) entry)))
	   quail-keymap))))