diff options
| author | Kenichi Handa | 1997-06-21 01:14:06 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1997-06-21 01:14:06 +0000 |
| commit | 9a6428f8b8dac9a48c4dd0d40a42f8cefe47ab88 (patch) | |
| tree | 137f52c1fe2f951a90f3b61afa46265f11b88fa1 | |
| parent | 6eabea8c48195de2f6da410f961422b10b53d82b (diff) | |
| download | emacs-9a6428f8b8dac9a48c4dd0d40a42f8cefe47ab88.tar.gz emacs-9a6428f8b8dac9a48c4dd0d40a42f8cefe47ab88.zip | |
(quail-help): Use with-output-to-temp-buffer.
(quail-translation-help): Likewise.
(quail-conversion-help): Likewise.
| -rw-r--r-- | lisp/international/quail.el | 111 |
1 files changed, 51 insertions, 60 deletions
diff --git a/lisp/international/quail.el b/lisp/international/quail.el index 945c970daed..01eeec09019 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el | |||
| @@ -1461,41 +1461,37 @@ All possible translations of the current key and whole possible longer keys | |||
| 1461 | (defun quail-help () | 1461 | (defun quail-help () |
| 1462 | "Show brief description of the current Quail package." | 1462 | "Show brief description of the current Quail package." |
| 1463 | (interactive) | 1463 | (interactive) |
| 1464 | (let ((package quail-current-package) | 1464 | (let ((package quail-current-package)) |
| 1465 | (buf (get-buffer-create "*Quail-help*"))) | 1465 | (with-output-to-temp-buffer "*Quail-Help*" |
| 1466 | (save-excursion | 1466 | (save-excursion |
| 1467 | (set-buffer buf) | 1467 | (set-buffer standard-output) |
| 1468 | (erase-buffer) | 1468 | (let ((quail-current-package package)) |
| 1469 | (setq quail-current-package package) | 1469 | (insert "Quail input method (name:" |
| 1470 | (insert "Quail input method (name:" | 1470 | (quail-name) |
| 1471 | (quail-name) | 1471 | ", mode line indicator:[" |
| 1472 | ", mode line indicator:[" | 1472 | (quail-title) |
| 1473 | (quail-title) | 1473 | "])\n---- Documentation ----\n" |
| 1474 | "])\n---- Documentation ----\n" | 1474 | (quail-docstring)) |
| 1475 | (quail-docstring)) | 1475 | (newline) |
| 1476 | (newline) | 1476 | (if (quail-show-layout) (quail-show-kbd-layout)) |
| 1477 | (if (quail-show-layout) (quail-show-kbd-layout)) | 1477 | (quail-help-insert-keymap-description |
| 1478 | (insert ) | 1478 | quail-mode-map |
| 1479 | (quail-help-insert-keymap-description | 1479 | "---- Key bindings (before starting translation) ---- |
| 1480 | quail-mode-map | ||
| 1481 | "---- Key bindings (before starting translation) ---- | ||
| 1482 | key binding | 1480 | key binding |
| 1483 | --- -------\n") | 1481 | --- -------\n") |
| 1484 | (quail-help-insert-keymap-description | 1482 | (quail-help-insert-keymap-description |
| 1485 | (quail-translation-keymap) | 1483 | (quail-translation-keymap) |
| 1486 | "--- Key bindings (while translating) --- | 1484 | "--- Key bindings (while translating) --- |
| 1487 | key binding | 1485 | key binding |
| 1488 | --- -------\n") | 1486 | --- -------\n") |
| 1489 | (if (quail-conversion-keymap) | 1487 | (if (quail-conversion-keymap) |
| 1490 | (quail-help-insert-keymap-description | 1488 | (quail-help-insert-keymap-description |
| 1491 | (quail-conversion-keymap) | 1489 | (quail-conversion-keymap) |
| 1492 | "--- Key bindings (while converting) --- | 1490 | "--- Key bindings (while converting) --- |
| 1493 | key binding | 1491 | key binding |
| 1494 | --- -------\n")) | 1492 | --- -------\n")) |
| 1495 | (goto-char (point-min)) | 1493 | (help-mode)))))) |
| 1496 | (set-buffer-modified-p nil) | 1494 | |
| 1497 | (help-mode)) | ||
| 1498 | (display-buffer buf))) | ||
| 1499 | 1495 | ||
| 1500 | (defun quail-help-insert-keymap-description (keymap &optional header) | 1496 | (defun quail-help-insert-keymap-description (keymap &optional header) |
| 1501 | (let (from to) | 1497 | (let (from to) |
| @@ -1543,45 +1539,40 @@ key binding | |||
| 1543 | "Show help message while translating in Quail mode." | 1539 | "Show help message while translating in Quail mode." |
| 1544 | (interactive) | 1540 | (interactive) |
| 1545 | (let ((package quail-current-package) | 1541 | (let ((package quail-current-package) |
| 1546 | (current-key quail-current-key) | 1542 | (current-key quail-current-key)) |
| 1547 | (buf (get-buffer-create "*Quail-Help*"))) | 1543 | (with-output-to-temp-buffer "*Quail-Help*" |
| 1548 | (save-excursion | 1544 | (save-excursion |
| 1549 | (set-buffer buf) | 1545 | (set-buffer standard-output) |
| 1550 | (erase-buffer) | 1546 | (let ((quail-current-package package)) |
| 1551 | (setq quail-current-package package) | 1547 | (princ "You are translating the key sequence ") |
| 1552 | (insert | 1548 | (prin1 quail-current-key) |
| 1553 | (format "You are translating the key sequence \"%s\" in Quail mode.\n" | 1549 | (princ" in Quail mode.\n") |
| 1554 | quail-current-key)) | 1550 | (quail-help-insert-keymap-description |
| 1555 | (quail-help-insert-keymap-description | 1551 | (quail-translation-keymap) |
| 1556 | (quail-translation-keymap) | 1552 | "----------------------- |
| 1557 | "----------------------- | ||
| 1558 | key binding | 1553 | key binding |
| 1559 | --- -------\n") | 1554 | --- -------\n")) |
| 1560 | (goto-char (point-min)) | 1555 | (help-mode))))) |
| 1561 | (set-buffer-modified-p nil)) | 1556 | |
| 1562 | (display-buffer buf))) | ||
| 1563 | |||
| 1564 | (defun quail-conversion-help () | 1557 | (defun quail-conversion-help () |
| 1565 | "Show help message while converting in Quail mode." | 1558 | "Show help message while converting in Quail mode." |
| 1566 | (interactive) | 1559 | (interactive) |
| 1567 | (let ((package quail-current-package) | 1560 | (let ((package quail-current-package) |
| 1568 | (str (buffer-substring (overlay-start quail-conv-overlay) | 1561 | (str (buffer-substring (overlay-start quail-conv-overlay) |
| 1569 | (overlay-end quail-conv-overlay))) | 1562 | (overlay-end quail-conv-overlay)))) |
| 1570 | (buf (get-buffer-create "*Quail-Help*"))) | 1563 | (with-output-to-temp-buffer "*Quail-Help*" |
| 1571 | (save-excursion | 1564 | (save-excursion |
| 1572 | (set-buffer buf) | 1565 | (set-buffer standard-output) |
| 1573 | (erase-buffer) | 1566 | (let ((quail-current-package package)) |
| 1574 | (setq quail-current-package package) | 1567 | (princ "You are converting the string ") |
| 1575 | (insert | 1568 | (prin1 str) |
| 1576 | (format "You are converting the string \"%s\" in Quail mode.\n" str)) | 1569 | (princ " in Quail mode.\n") |
| 1577 | (quail-help-insert-keymap-description | 1570 | (quail-help-insert-keymap-description |
| 1578 | (quail-conversion-keymap) | 1571 | (quail-conversion-keymap) |
| 1579 | "----------------------- | 1572 | "----------------------- |
| 1580 | key binding | 1573 | key binding |
| 1581 | --- -------\n") | 1574 | --- -------\n")) |
| 1582 | (goto-char (point-min)) | 1575 | (help-mode))))) |
| 1583 | (set-buffer-modified-p nil)) | ||
| 1584 | (display-buffer buf))) | ||
| 1585 | 1576 | ||
| 1586 | 1577 | ||
| 1587 | (defvar quail-directory-name "quail" | 1578 | (defvar quail-directory-name "quail" |