diff options
| author | Kenichi Handa | 2000-09-21 20:15:55 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2000-09-21 20:15:55 +0000 |
| commit | 8179cccd88a3f114b0e4891c033ecd302dfb094e (patch) | |
| tree | c1e3db97ab6a3f05c602fd1646421c0fca85af5b | |
| parent | 623a0aae17d2860be73f7c126a28690406535370 (diff) | |
| download | emacs-8179cccd88a3f114b0e4891c033ecd302dfb094e.tar.gz emacs-8179cccd88a3f114b0e4891c033ecd302dfb094e.zip | |
(quail-help): The output message is improved.
| -rw-r--r-- | lisp/international/quail.el | 90 |
1 files changed, 53 insertions, 37 deletions
diff --git a/lisp/international/quail.el b/lisp/international/quail.el index a93fd76abe5..d32d5fd3b61 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el | |||
| @@ -729,6 +729,11 @@ you type is correctly handled." | |||
| 729 | char) | 729 | char) |
| 730 | ch)))))) | 730 | ch)))))) |
| 731 | 731 | ||
| 732 | (defun quail-keyseq-translate (keyseq) | ||
| 733 | (apply 'string | ||
| 734 | (mapcar (function (lambda (x) (quail-keyboard-translate x))) | ||
| 735 | keyseq))) | ||
| 736 | |||
| 732 | ;; Insert the visual keyboard layout table according to KBD-LAYOUT. | 737 | ;; Insert the visual keyboard layout table according to KBD-LAYOUT. |
| 733 | ;; The format of KBD-LAYOUT is the same as `quail-keyboard-layout'. | 738 | ;; The format of KBD-LAYOUT is the same as `quail-keyboard-layout'. |
| 734 | (defun quail-insert-kbd-layout (kbd-layout) | 739 | (defun quail-insert-kbd-layout (kbd-layout) |
| @@ -1349,7 +1354,7 @@ The returned value is a Quail map specific to KEY." | |||
| 1349 | generated-events)) | 1354 | generated-events)) |
| 1350 | 1355 | ||
| 1351 | ;; Since KEY doesn't start any translation, just return it. | 1356 | ;; Since KEY doesn't start any translation, just return it. |
| 1352 | ;; But, translate KEY if necessary. | 1357 | ;; But translate KEY if necessary. |
| 1353 | (if (and (integerp key) | 1358 | (if (and (integerp key) |
| 1354 | (quail-kbd-translate)) | 1359 | (quail-kbd-translate)) |
| 1355 | (setq key (quail-keyboard-translate key))) | 1360 | (setq key (quail-keyboard-translate key))) |
| @@ -1433,7 +1438,7 @@ The returned value is a Quail map specific to KEY." | |||
| 1433 | generated-events)) | 1438 | generated-events)) |
| 1434 | 1439 | ||
| 1435 | ;; Since KEY doesn't start any translation, just return it. | 1440 | ;; Since KEY doesn't start any translation, just return it. |
| 1436 | ;; But, translate KEY if necessary. | 1441 | ;; But translate KEY if necessary. |
| 1437 | (if (and (integerp key) | 1442 | (if (and (integerp key) |
| 1438 | (quail-kbd-translate)) | 1443 | (quail-kbd-translate)) |
| 1439 | (setq key (quail-keyboard-translate key))) | 1444 | (setq key (quail-keyboard-translate key))) |
| @@ -1464,28 +1469,28 @@ The returned value is a Quail map specific to KEY." | |||
| 1464 | (let ((func (quail-update-translation-function))) | 1469 | (let ((func (quail-update-translation-function))) |
| 1465 | (if func | 1470 | (if func |
| 1466 | (setq control-flag (funcall func control-flag)) | 1471 | (setq control-flag (funcall func control-flag)) |
| 1467 | (if (numberp control-flag) | 1472 | (cond ((numberp control-flag) |
| 1468 | (let ((len (length quail-current-key))) | 1473 | (let ((len (length quail-current-key))) |
| 1469 | (if (= len 1) | 1474 | (if (= control-flag 0) |
| 1470 | (setq control-flag t | 1475 | (setq quail-current-str |
| 1471 | quail-current-str quail-current-key) | 1476 | (if (quail-kbd-translate) |
| 1472 | (if input-method-exit-on-first-char | 1477 | (quail-keyseq-translate quail-current-key) |
| 1473 | (setq len control-flag) | 1478 | quail-current-key))) |
| 1474 | (while (> len control-flag) | 1479 | (or input-method-exit-on-first-char |
| 1475 | (setq len (1- len)) | 1480 | (while (> len control-flag) |
| 1476 | (setq unread-command-events | 1481 | (setq len (1- len)) |
| 1477 | (cons (aref quail-current-key len) | 1482 | (setq unread-command-events |
| 1478 | unread-command-events)))) | 1483 | (cons (aref quail-current-key len) |
| 1479 | (if quail-current-str | 1484 | unread-command-events)))))) |
| 1480 | (if input-method-exit-on-first-char | 1485 | ((null control-flag) |
| 1481 | (setq control-flag t)) | 1486 | (unless quail-current-str |
| 1482 | (setq quail-current-str | 1487 | (setq quail-current-str |
| 1483 | (substring quail-current-key 0 len))))) | 1488 | (if (quail-kbd-translate) |
| 1484 | (if quail-current-str | 1489 | (quail-keyseq-translate quail-current-key) |
| 1485 | (if (and input-method-exit-on-first-char | 1490 | quail-current-key)) |
| 1486 | (quail-simple)) | 1491 | (if (and input-method-exit-on-first-char |
| 1487 | (setq control-flag t)) | 1492 | (quail-simple)) |
| 1488 | (setq quail-current-str quail-current-key))))) | 1493 | (setq control-flag t))))))) |
| 1489 | (or input-method-use-echo-area | 1494 | (or input-method-use-echo-area |
| 1490 | (progn | 1495 | (progn |
| 1491 | (quail-delete-region) | 1496 | (quail-delete-region) |
| @@ -1956,6 +1961,8 @@ or in a newly created frame (if the selected frame has no other windows)." | |||
| 1956 | ((null guidance) | 1961 | ((null guidance) |
| 1957 | ;; Show the current input keys. | 1962 | ;; Show the current input keys. |
| 1958 | (let ((key quail-current-key)) | 1963 | (let ((key quail-current-key)) |
| 1964 | (if (quail-kbd-translate) | ||
| 1965 | (setq key (quail-keyseq-translate key))) | ||
| 1959 | (save-excursion | 1966 | (save-excursion |
| 1960 | (set-buffer quail-guidance-buf) | 1967 | (set-buffer quail-guidance-buf) |
| 1961 | (erase-buffer) | 1968 | (erase-buffer) |
| @@ -2415,27 +2422,36 @@ package to describe." | |||
| 2415 | (insert " | 2422 | (insert " |
| 2416 | KEYBOARD LAYOUT | 2423 | KEYBOARD LAYOUT |
| 2417 | --------------- | 2424 | --------------- |
| 2418 | This input method is designed to pretend you are using a keyboard | 2425 | This input method works by translating individual input characters. |
| 2419 | with the following \"virtual\" layout: | 2426 | Assuming that your actual keyboard has the `") |
| 2427 | (help-insert-xref-button | ||
| 2428 | quail-keyboard-layout-type | ||
| 2429 | #'quail-show-keyboard-layout quail-keyboard-layout-type | ||
| 2430 | "mouse-2, RET: show this layout") | ||
| 2431 | (insert "' layout, | ||
| 2432 | translation results in the following \"virtual\" keyboard layout: | ||
| 2420 | ") | 2433 | ") |
| 2421 | (setq done-list | 2434 | (setq done-list |
| 2422 | (quail-insert-kbd-layout quail-keyboard-layout)) | 2435 | (quail-insert-kbd-layout quail-keyboard-layout)) |
| 2423 | (insert "\ | 2436 | (insert "If your keyboard has a different layout, rearranged from |
| 2424 | The input method implements that result by assuming you have | 2437 | `") |
| 2425 | a `") | ||
| 2426 | (help-insert-xref-button | 2438 | (help-insert-xref-button |
| 2427 | quail-keyboard-layout-type | 2439 | "standard" |
| 2428 | #'quail-show-keyboard-layout quail-keyboard-layout-type | 2440 | #'quail-show-keyboard-layout "standard" |
| 2429 | "mouse-2, RET: show this layout") | 2441 | "mouse-2, RET: show this layout") |
| 2430 | (insert "' keyboard layout, and translating characters accordingly. | 2442 | (insert "', the \"virtual\" keyboard you get with this input method |
| 2431 | If the layout is different from your keyboard, or you see the | 2443 | will be rearranged in the same way. |
| 2432 | different characters when you type keys according to this layout, | 2444 | |
| 2433 | adjust the variable `quail-keyboard-layout-type' ") | 2445 | You can set the variable `quail-keyboard-layout-type' to specify |
| 2446 | the physical layout of your keyboard; the tables shown in | ||
| 2447 | documentation of input methods including this one are based on the | ||
| 2448 | physical keyboard layout as specified with that variable. | ||
| 2449 | ") | ||
| 2434 | (help-insert-xref-button | 2450 | (help-insert-xref-button |
| 2435 | "[customize it]" | 2451 | "[customize the keyboard layout]" |
| 2436 | #'customize-variable 'quail-keyboard-layout-type | 2452 | #'customize-variable 'quail-keyboard-layout-type |
| 2437 | "mouse-2, RET: set keyboard layout type") | 2453 | "mouse-2, RET: set keyboard layout type") |
| 2438 | (insert ".\n")) | 2454 | (insert "\n")) |
| 2439 | 2455 | ||
| 2440 | ;; Show key sequences. | 2456 | ;; Show key sequences. |
| 2441 | (let ((decode-map (list 'decode-map)) | 2457 | (let ((decode-map (list 'decode-map)) |