Function: quail-input-method

quail-input-method is a byte-compiled function defined in quail.el.gz.

Signature

(quail-input-method KEY)

Source Code

;; Defined in /usr/src/emacs/lisp/international/quail.el.gz
(defun quail-input-method (key)
  (if (or (and (or buffer-read-only
                   (and (get-char-property (point) 'read-only)
                        (get-char-property (point) 'front-sticky)))
	       (not (or inhibit-read-only
			(get-char-property (point) 'inhibit-read-only))))
	  (and overriding-terminal-local-map
               ;; If the overriding map is `universal-argument-map', that
               ;; must mean the user has pressed 'C-u KEY'.  If KEY has a
               ;; binding in `universal-argument-map' just return
               ;; (list KEY), otherwise act as if there was no
               ;; overriding map.
               (or (not (eq (cadr overriding-terminal-local-map)
                            universal-argument-map))
                   (lookup-key overriding-terminal-local-map (vector key))))
	  overriding-local-map)
      (list key)
    (quail-setup-overlays (quail-conversion-keymap))
    (with-silent-modifications
      (unwind-protect
	  (let ((input-string (if (quail-conversion-keymap)
				  (quail-start-conversion key)
				(quail-start-translation key))))
	    (setq quail-guidance-str "")
	    (when (and (stringp input-string)
		       (> (length input-string) 0))
	      (if input-method-exit-on-first-char
		  (list (aref input-string 0))
		(quail-input-string-to-events input-string))))
	(quail-delete-overlays)
	;; Run this hook only when the current input method doesn't require
	;; conversion.  When conversion is required, the conversion function
	;; should run this hook at a proper timing.
	(unless (quail-conversion-keymap)
	  (run-hooks 'input-method-after-insert-chunk-hook))))))