comparison lisp/international/quail.el @ 19723:3ada64a43911

(quail-update-guidance): If PROMPTKEY is specified in the original CXTERM dictionary, show also candidates in Quail guidance buffer. (quail-show-translations): Likewise.
author Kenichi Handa <handa@m17n.org>
date Wed, 03 Sep 1997 05:46:54 +0000
parents 32c3f7d9ef10
children b1774d359a3d
comparison
equal deleted inserted replaced
19722:dd39cae4cf0f 19723:3ada64a43911
1455 "Update the Quail guidance buffer and completion buffer (if displayed now)." 1455 "Update the Quail guidance buffer and completion buffer (if displayed now)."
1456 ;; Update guidance buffer. 1456 ;; Update guidance buffer.
1457 (if (or input-method-verbose-flag 1457 (if (or input-method-verbose-flag
1458 (not (eq (selected-window) (minibuffer-window)))) 1458 (not (eq (selected-window) (minibuffer-window))))
1459 (let ((guidance (quail-guidance))) 1459 (let ((guidance (quail-guidance)))
1460 (cond ((eq guidance t) 1460 (cond ((or (eq guidance t)
1461 (listp guidance))
1461 ;; Show the current possible translations. 1462 ;; Show the current possible translations.
1462 (quail-show-translations)) 1463 (quail-show-translations))
1463 ((null guidance) 1464 ((null guidance)
1464 ;; Show the current input keys. 1465 ;; Show the current input keys.
1465 (let ((key quail-current-key)) 1466 (let ((key quail-current-key))
1466 (save-excursion 1467 (save-excursion
1467 (set-buffer quail-guidance-buf) 1468 (set-buffer quail-guidance-buf)
1468 (erase-buffer) 1469 (erase-buffer)
1469 (insert key)))) 1470 (insert key)))))))
1470 ((listp guidance)
1471 ;; Show alternative characters specified in this alist.
1472 (let* ((key quail-current-key)
1473 (len (length key))
1474 (i 0)
1475 ch alternative)
1476 (save-excursion
1477 (set-buffer quail-guidance-buf)
1478 (erase-buffer)
1479 (while (< i len)
1480 (setq ch (aref key i))
1481 (setq alternative (cdr (assoc ch guidance)))
1482 (insert (or alternative ch))
1483 (setq i (1+ i)))))))))
1484 1471
1485 ;; Update completion buffer if displayed now. We highlight the 1472 ;; Update completion buffer if displayed now. We highlight the
1486 ;; selected candidate string in *Completion* buffer if any. 1473 ;; selected candidate string in *Completion* buffer if any.
1487 (let ((win (get-buffer-window quail-completion-buf)) 1474 (let ((win (get-buffer-window quail-completion-buf))
1488 key str pos) 1475 key str pos)
1523 (save-excursion 1510 (save-excursion
1524 (set-buffer quail-guidance-buf) 1511 (set-buffer quail-guidance-buf)
1525 (erase-buffer) 1512 (erase-buffer)
1526 1513
1527 ;; Show the current key. 1514 ;; Show the current key.
1528 (insert key) 1515 (let ((guidance (quail-guidance)))
1516 (if (listp guidance)
1517 ;; We must show the specified PROMPTKEY instead of the
1518 ;; actual typed keys.
1519 (let ((i 0)
1520 (len (length key))
1521 prompt-key)
1522 (while (< i len)
1523 (setq prompt-key (cdr (assoc (aref key i) guidance)))
1524 (insert (or prompt-key (aref key i)))
1525 (setq i (1+ i))))
1526 (insert key)))
1529 1527
1530 ;; Show followable keys. 1528 ;; Show followable keys.
1531 (if (cdr map) 1529 (if (cdr map)
1532 (let ((l (cdr map))) 1530 (let ((l (cdr map)))
1533 (insert "[") 1531 (insert "[")