Function: quail-find-key1

quail-find-key1 is a byte-compiled function defined in quail.el.gz.

Signature

(quail-find-key1 MAP KEY CHAR KEY-LIST)

Source Code

;; Defined in /usr/src/emacs/lisp/international/quail.el.gz
;; Helper function for quail-find-key.  Prepend key strings to type
;; for inputting CHAR by the current input method to KEY-LIST and
;; return the result.  MAP is an element of the current Quail map
;; reached by typing keys in KEY.

(defun quail-find-key1 (map key char key-list)
  (let ((trans (car map))
	(found-here nil))
    (cond ((stringp trans)
	   (setq found-here
		 (and (= (length trans) 1)
		      (quail-char-equal-p (aref trans 0) char))))
	  ((or (vectorp trans) (consp trans))
	   (if (consp trans)
	       (setq trans (cdr trans)))
	   (setq found-here
		 (catch 'tag
		   (dotimes (i (length trans))
		     (let ((target (aref trans i)))
		       (if (integerp target)
			   (if (quail-char-equal-p target char)
			       (throw 'tag t))
			 (if (and (= (length target) 1)
				  (quail-char-equal-p (aref target 0) char))
			     (throw 'tag t))))))))
	    ((integerp trans)
	     (setq found-here (quail-char-equal-p trans char))))
    (if found-here
	(setq key-list (cons key key-list)))
    (if (> (length key) 1)
	(dolist (elt (cdr map))
	  (setq key-list
		(quail-find-key1 (cdr elt) (format "%s%c" key (car elt))
				     char key-list))))
    key-list))