diff options
| author | Kenichi Handa | 2000-08-29 05:37:48 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2000-08-29 05:37:48 +0000 |
| commit | 464cc13084c958d2784cc0a105178ccf54f9462f (patch) | |
| tree | 158d3e14f36d793b68d26349a39b463022ef0874 /lisp | |
| parent | cba62b78c317d43c935a7a9aa9c70d56b34b8db7 (diff) | |
| download | emacs-464cc13084c958d2784cc0a105178ccf54f9462f.tar.gz emacs-464cc13084c958d2784cc0a105178ccf54f9462f.zip | |
(help-xref-mule-regexp-template): New variable.
(describe-input-method): Temporarily activate the specfied input
method to display the information.
(describe-language-environment): Hyperlinks to mule related items.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/international/mule-cmds.el | 142 |
1 files changed, 89 insertions, 53 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 68d456c1f09..8d69e1c17d0 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el | |||
| @@ -170,6 +170,15 @@ | |||
| 170 | ;;; ;; Here's an alternative key binding for X users (Shift-SPACE). | 170 | ;;; ;; Here's an alternative key binding for X users (Shift-SPACE). |
| 171 | ;;; (define-key global-map [?\S- ] 'toggle-input-method) | 171 | ;;; (define-key global-map [?\S- ] 'toggle-input-method) |
| 172 | 172 | ||
| 173 | ;;; Mule related hyperlinks. | ||
| 174 | (defconst help-xref-mule-regexp-template | ||
| 175 | (purecopy (concat "\\(\\<\\(" | ||
| 176 | "\\(coding system\\)\\|" | ||
| 177 | "\\(input method\\)" | ||
| 178 | "\\)\\s-+\\)?" | ||
| 179 | ;; Note starting with word-syntax character: | ||
| 180 | "`\\(\\sw\\(\\sw\\|\\s_\\)+\\)'"))) | ||
| 181 | |||
| 173 | (defun coding-system-change-eol-conversion (coding-system eol-type) | 182 | (defun coding-system-change-eol-conversion (coding-system eol-type) |
| 174 | "Return a coding system which differs from CODING-SYSTEM in eol conversion. | 183 | "Return a coding system which differs from CODING-SYSTEM in eol conversion. |
| 175 | The returned coding system converts end-of-line by EOL-TYPE | 184 | The returned coding system converts end-of-line by EOL-TYPE |
| @@ -1067,10 +1076,20 @@ The default is to use the most recent input method specified | |||
| 1067 | (setq input-method (symbol-name input-method))) | 1076 | (setq input-method (symbol-name input-method))) |
| 1068 | (if (null input-method) | 1077 | (if (null input-method) |
| 1069 | (describe-current-input-method) | 1078 | (describe-current-input-method) |
| 1070 | (with-output-to-temp-buffer "*Help*" | 1079 | (let ((current current-input-method)) |
| 1071 | (let ((elt (assoc input-method input-method-alist))) | 1080 | (condition-case nil |
| 1072 | (princ (format "Input method: %s (`%s' in mode line) for %s\n %s\n" | 1081 | (progn |
| 1073 | input-method (nth 3 elt) (nth 1 elt) (nth 4 elt))))))) | 1082 | (save-excursion |
| 1083 | (activate-input-method input-method) | ||
| 1084 | (describe-current-input-method)) | ||
| 1085 | (activate-input-method current)) | ||
| 1086 | (error | ||
| 1087 | (activate-input-method current) | ||
| 1088 | (with-output-to-temp-buffer "*Help*" | ||
| 1089 | (let ((elt (assoc input-method input-method-alist))) | ||
| 1090 | (princ (format | ||
| 1091 | "Input method: %s (`%s' in mode line) for %s\n %s\n" | ||
| 1092 | input-method (nth 3 elt) (nth 1 elt) (nth 4 elt)))))))))) | ||
| 1074 | 1093 | ||
| 1075 | (defun describe-current-input-method () | 1094 | (defun describe-current-input-method () |
| 1076 | "Describe the input method currently in use." | 1095 | "Describe the input method currently in use." |
| @@ -1473,57 +1492,74 @@ of buffer-file-coding-system set by this function." | |||
| 1473 | (error "No documentation for the specified language")) | 1492 | (error "No documentation for the specified language")) |
| 1474 | (if (symbolp language-name) | 1493 | (if (symbolp language-name) |
| 1475 | (setq language-name (symbol-name language-name))) | 1494 | (setq language-name (symbol-name language-name))) |
| 1476 | (let ((doc (get-language-info language-name 'documentation))) | 1495 | (let ((doc (get-language-info language-name 'documentation)) |
| 1496 | pos) | ||
| 1477 | (with-output-to-temp-buffer "*Help*" | 1497 | (with-output-to-temp-buffer "*Help*" |
| 1478 | (princ-list language-name " language environment" "\n") | 1498 | (save-excursion |
| 1479 | (if (stringp doc) | 1499 | (set-buffer standard-output) |
| 1480 | (progn | 1500 | (insert language-name " language environment\n\n") |
| 1481 | (princ-list doc) | 1501 | (if (stringp doc) |
| 1482 | (terpri))) | 1502 | (insert doc "\n\n")) |
| 1483 | (let ((str (get-language-info language-name 'sample-text))) | 1503 | (let ((str (get-language-info language-name 'sample-text))) |
| 1484 | (if (stringp str) | 1504 | (if (stringp str) |
| 1485 | (progn | 1505 | (insert "Sample text:\n " str "\n\n"))) |
| 1486 | (princ "Sample text:\n") | 1506 | (let ((input-method (get-language-info language-name 'input-method)) |
| 1487 | (princ-list " " str) | 1507 | (l (copy-sequence input-method-alist))) |
| 1488 | (terpri)))) | 1508 | (insert "Input methods") |
| 1489 | (let ((input-method (get-language-info language-name 'input-method)) | 1509 | (when input-method |
| 1490 | (l (copy-sequence input-method-alist))) | 1510 | (insert " (default, " input-method ")") |
| 1491 | (princ "Input methods") | 1511 | (setq input-method (assoc input-method input-method-alist)) |
| 1492 | (when input-method | 1512 | (setq l (cons input-method (delete input-method l)))) |
| 1493 | (princ (format " (default, %s)" input-method)) | 1513 | (insert ":\n") |
| 1494 | (setq input-method (assoc input-method input-method-alist)) | ||
| 1495 | (setq l (cons input-method (delete input-method l)))) | ||
| 1496 | (princ ":\n") | ||
| 1497 | (while l | ||
| 1498 | (if (string= language-name (nth 1 (car l))) | ||
| 1499 | (princ-list " " (car (car l)) | ||
| 1500 | (format " (`%s' in mode line)" (nth 3 (car l))))) | ||
| 1501 | (setq l (cdr l)))) | ||
| 1502 | (terpri) | ||
| 1503 | (princ "Character sets:\n") | ||
| 1504 | (let ((l (get-language-info language-name 'charset))) | ||
| 1505 | (if (null l) | ||
| 1506 | (princ-list " nothing specific to " language-name) | ||
| 1507 | (while l | ||
| 1508 | (princ-list " " (car l) ": " | ||
| 1509 | (charset-description (car l))) | ||
| 1510 | (setq l (cdr l))))) | ||
| 1511 | (terpri) | ||
| 1512 | (princ "Coding systems:\n") | ||
| 1513 | (let ((l (get-language-info language-name 'coding-system))) | ||
| 1514 | (if (null l) | ||
| 1515 | (princ-list " nothing specific to " language-name) | ||
| 1516 | (while l | 1514 | (while l |
| 1517 | (princ (format " %s (`%c' in mode line):\n\t%s\n" | 1515 | (when (string= language-name (nth 1 (car l))) |
| 1518 | (car l) | 1516 | (insert " " (car (car l))) |
| 1519 | (coding-system-mnemonic (car l)) | 1517 | (search-backward (car (car l))) |
| 1520 | (coding-system-doc-string (car l)))) | 1518 | (help-xref-button 0 #'describe-input-method (car (car l)) |
| 1521 | (let ((aliases (coding-system-get (car l) 'alias-coding-systems))) | 1519 | "mouse-2, RET: describe this input method") |
| 1522 | (when aliases | 1520 | (goto-char (point-max)) |
| 1523 | (princ "\t") | 1521 | (insert " (\"" (nth 3 (car l)) "\" in mode line)\n")) |
| 1524 | (princ (cons 'alias: (cdr aliases))) | 1522 | (setq l (cdr l))) |
| 1525 | (terpri))) | 1523 | (insert "\n")) |
| 1526 | (setq l (cdr l)))))))) | 1524 | (insert "Character sets:\n") |
| 1525 | (let ((l (get-language-info language-name 'charset))) | ||
| 1526 | (if (null l) | ||
| 1527 | (insert " nothing specific to " language-name "\n") | ||
| 1528 | (while l | ||
| 1529 | (insert " " (symbol-name (car l))) | ||
| 1530 | (search-backward (symbol-name (car l))) | ||
| 1531 | (help-xref-button 0 #'describe-character-set (car l) | ||
| 1532 | "mouse-2, RET: describe this character set") | ||
| 1533 | (goto-char (point-max)) | ||
| 1534 | (insert ": " (charset-description (car l)) "\n") | ||
| 1535 | (setq l (cdr l))))) | ||
| 1536 | (insert "\n") | ||
| 1537 | (insert "Coding systems:\n") | ||
| 1538 | (let ((l (get-language-info language-name 'coding-system))) | ||
| 1539 | (if (null l) | ||
| 1540 | (insert " nothing specific to " language-name "\n") | ||
| 1541 | (while l | ||
| 1542 | (insert " " (symbol-name (car l))) | ||
| 1543 | (search-backward (symbol-name (car l))) | ||
| 1544 | (help-xref-button 0 #'describe-coding-system (car l) | ||
| 1545 | "mouse-2, RET: describe this coding system") | ||
| 1546 | (goto-char (point-max)) | ||
| 1547 | (insert " (`" | ||
| 1548 | (coding-system-mnemonic (car l)) | ||
| 1549 | "' in mode line):\n\t" | ||
| 1550 | (coding-system-doc-string (car l)) | ||
| 1551 | "\n") | ||
| 1552 | (let ((aliases (coding-system-get (car l) | ||
| 1553 | 'alias-coding-systems))) | ||
| 1554 | (when aliases | ||
| 1555 | (insert "\t(alias:") | ||
| 1556 | (while aliases | ||
| 1557 | (insert " " (symbol-name (car aliases))) | ||
| 1558 | (setq aliases (cdr aliases))) | ||
| 1559 | (insert ")\n"))) | ||
| 1560 | (setq l (cdr l))))) | ||
| 1561 | (help-setup-xref (list #'describe-language-environment language-name) | ||
| 1562 | (interactive-p)))))) | ||
| 1527 | 1563 | ||
| 1528 | ;;; Locales. | 1564 | ;;; Locales. |
| 1529 | 1565 | ||