Function: quail-show-guidance

quail-show-guidance is a byte-compiled function defined in quail.el.gz.

Signature

(quail-show-guidance)

Documentation

Display a guidance for Quail input method in some window.

The guidance is normally displayed at the echo area, or in a newly created frame (if the current buffer is a minibuffer and the selected frame has no other windows).

Source Code

;; Defined in /usr/src/emacs/lisp/international/quail.el.gz
(defun quail-show-guidance ()
  "Display a guidance for Quail input method in some window.
The guidance is normally displayed at the echo area,
or in a newly created frame (if the current buffer is a
minibuffer and the selected frame has no other windows)."
  ;; At first, setup a buffer for completion.
  (quail-setup-completion-buf)
  (bury-buffer quail-completion-buf)

  ;; Then, show the guidance.
  (when (and
         ;; Don't try to display guidance on an expired minibuffer.  This
         ;; would go into an infinite wait rather than executing the user's
         ;; command.  Bug #45792.
         (not (eq major-mode 'minibuffer-inactive-mode))
         (quail-require-guidance-buf)
	 (not input-method-use-echo-area)
	 (null unread-command-events)
	 (null unread-post-input-method-events))
    (if (minibufferp)
	(if (eq (minibuffer-window) (frame-root-window))
	    ;; Use another frame.  It is sure that we are using some
	    ;; window system.
	    (let ((guidance quail-guidance-str))
	      (or (frame-live-p quail-guidance-frame)
		  (setq quail-guidance-frame
			(quail-make-guidance-frame)))
	      (or (buffer-live-p quail-guidance-buf)
		  (setq quail-guidance-buf
			(get-buffer-create " *Quail-guidance*")))
	      (with-current-buffer quail-guidance-buf
		(erase-buffer)
		(setq cursor-type nil)
		(insert guidance))
              (let ((win (frame-root-window quail-guidance-frame)))
                (set-window-buffer win quail-guidance-buf)
                (set-window-dedicated-p win t))
	      (quail-minibuffer-message
	       (format " [%s]" current-input-method-title)))
	  ;; Show the guidance in the next line of the current
	  ;; minibuffer.
	  (quail-minibuffer-message
	   (format "  [%s]\n%s"
		   current-input-method-title quail-guidance-str)))
      ;; Show the guidance in echo area without logging.
      (let ((message-log-max nil))
	(message "%s" quail-guidance-str)))))