diff options
| author | Kenichi Handa | 2000-08-29 05:38:34 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2000-08-29 05:38:34 +0000 |
| commit | 6c7b13cf7eedd25b0ee08d2da68ed94bb9919a5e (patch) | |
| tree | 35a14332b6b73a1e8184c7f876a406761cb4d440 | |
| parent | a399ef7b3ac87d1e8ea26f4067f438ab4adc5fdf (diff) | |
| download | emacs-6c7b13cf7eedd25b0ee08d2da68ed94bb9919a5e.tar.gz emacs-6c7b13cf7eedd25b0ee08d2da68ed94bb9919a5e.zip | |
(quail-help): New arg PACKAGE. Hyperlinks to mule related items.
(quail-help-insert-keymap-description): Use
substitute-command-keys instead of describe-bindings.
(quail-translation-help): Hyperlinks to mule related items.
| -rw-r--r-- | lisp/international/quail.el | 83 |
1 files changed, 39 insertions, 44 deletions
diff --git a/lisp/international/quail.el b/lisp/international/quail.el index f6848319484..ea6254d31ae 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el | |||
| @@ -1261,7 +1261,7 @@ The returned value is a Quail map specific to KEY." | |||
| 1261 | (quail-terminate-translation))) | 1261 | (quail-terminate-translation))) |
| 1262 | 1262 | ||
| 1263 | (defun quail-self-insert-command () | 1263 | (defun quail-self-insert-command () |
| 1264 | "Add the typed character to the key for translation." | 1264 | "Translate the typed character to by the current Quail map." |
| 1265 | (interactive "*") | 1265 | (interactive "*") |
| 1266 | (setq quail-current-key | 1266 | (setq quail-current-key |
| 1267 | (concat quail-current-key (char-to-string last-command-event))) | 1267 | (concat quail-current-key (char-to-string last-command-event))) |
| @@ -1994,51 +1994,48 @@ are shown (at most to the depth specified `quail-completion-max-depth')." | |||
| 1994 | (select-window (active-minibuffer-window)) | 1994 | (select-window (active-minibuffer-window)) |
| 1995 | (exit-minibuffer)))))) | 1995 | (exit-minibuffer)))))) |
| 1996 | 1996 | ||
| 1997 | (defun quail-help () | 1997 | (defun quail-help (&optional package) |
| 1998 | "Show brief description of the current Quail package." | 1998 | "Show brief description of the current Quail package. |
| 1999 | Optional 2nd arg PACKAGE specifies the alternative Quail package to describe." | ||
| 1999 | (interactive) | 2000 | (interactive) |
| 2000 | (let ((package quail-current-package)) | 2001 | (or package |
| 2001 | (with-output-to-temp-buffer "*Quail-Help*" | 2002 | (setq package quail-current-package)) |
| 2003 | (let ((help-xref-mule-regexp help-xref-mule-regexp-template)) | ||
| 2004 | (with-output-to-temp-buffer "*Help*" | ||
| 2002 | (save-excursion | 2005 | (save-excursion |
| 2003 | (set-buffer standard-output) | 2006 | (set-buffer standard-output) |
| 2004 | (let ((quail-current-package package)) | 2007 | (setq quail-current-package package) |
| 2005 | (insert "Quail input method (name:" | 2008 | (insert "Quail input method (name:" |
| 2006 | (quail-name) | 2009 | (quail-name) |
| 2007 | ", mode line indicator:[" | 2010 | ", mode line indicator:[" |
| 2008 | (quail-title) | 2011 | (quail-title) |
| 2009 | "])\n---- Documentation ----\n" | 2012 | "])\n\n---- Documentation ----\n" |
| 2010 | (quail-docstring)) | 2013 | (quail-docstring)) |
| 2011 | (newline) | 2014 | (newline) |
| 2012 | (if (quail-show-layout) (quail-show-kbd-layout)) | 2015 | (if (quail-show-layout) (quail-show-kbd-layout)) |
| 2013 | (quail-help-insert-keymap-description | 2016 | (quail-help-insert-keymap-description |
| 2014 | (quail-translation-keymap) | 2017 | (quail-translation-keymap) |
| 2015 | "--- Key bindings (while translating) --- | 2018 | (format "--- Key bindings%s ---\n" |
| 2016 | key binding | 2019 | (if (quail-conversion-keymap) |
| 2017 | --- -------\n") | 2020 | " (while translating)" |
| 2018 | (if (quail-conversion-keymap) | 2021 | ""))) |
| 2019 | (quail-help-insert-keymap-description | 2022 | (if (quail-conversion-keymap) |
| 2020 | (quail-conversion-keymap) | 2023 | (quail-help-insert-keymap-description |
| 2021 | "--- Key bindings (while converting) --- | 2024 | (quail-conversion-keymap) |
| 2022 | key binding | 2025 | "\n--- Key bindings (while converting) ---\n")) |
| 2023 | --- -------\n")) | 2026 | (setq quail-current-package nil) |
| 2024 | (help-mode)))))) | 2027 | (help-setup-xref (list #'quail-help package) |
| 2028 | (interactive-p)))))) | ||
| 2025 | 2029 | ||
| 2026 | (defun quail-help-insert-keymap-description (keymap &optional header) | 2030 | (defun quail-help-insert-keymap-description (keymap &optional header) |
| 2027 | (let (from to) | 2031 | (let (pos) |
| 2028 | (if header | 2032 | (if header |
| 2029 | (insert header)) | 2033 | (insert header)) |
| 2030 | (save-excursion | 2034 | (setq pos (point)) |
| 2031 | (save-window-excursion | 2035 | (insert (substitute-command-keys "\\{keymap}")) |
| 2032 | (let ((overriding-terminal-local-map keymap)) | 2036 | (goto-char pos) |
| 2033 | (describe-bindings)) | 2037 | (while (search-forward "quail-other-command" nil 'move) |
| 2034 | (set-buffer "*Help*") | 2038 | (delete-region (line-beginning-position) (1+ (line-end-position)))))) |
| 2035 | (goto-char (point-min)) | ||
| 2036 | (forward-line 4) | ||
| 2037 | (setq from (point)) | ||
| 2038 | (search-forward "Global Bindings:" nil 'move) | ||
| 2039 | (beginning-of-line) | ||
| 2040 | (setq to (point)))) | ||
| 2041 | (insert-buffer-substring "*Help*" from to))) | ||
| 2042 | 2039 | ||
| 2043 | (defun quail-show-kbd-layout () | 2040 | (defun quail-show-kbd-layout () |
| 2044 | "Show keyboard layout with key tops of multilingual characters." | 2041 | "Show keyboard layout with key tops of multilingual characters." |
| @@ -2098,19 +2095,17 @@ key binding | |||
| 2098 | (format "Translating key sequence %S by input method %S.\n" | 2095 | (format "Translating key sequence %S by input method %S.\n" |
| 2099 | quail-current-key (quail-name)) | 2096 | quail-current-key (quail-name)) |
| 2100 | keymap (quail-translation-keymap))) | 2097 | keymap (quail-translation-keymap))) |
| 2101 | (with-output-to-temp-buffer "*Quail-Help*" | 2098 | (with-output-to-temp-buffer "*Help*" |
| 2102 | (save-excursion | 2099 | (save-excursion |
| 2103 | (set-buffer standard-output) | 2100 | (set-buffer standard-output) |
| 2104 | (insert state-msg) | 2101 | (insert state-msg) |
| 2105 | (quail-help-insert-keymap-description | 2102 | (quail-help-insert-keymap-description |
| 2106 | keymap | 2103 | keymap |
| 2107 | "----------------------- | 2104 | "-----------------------\n") |
| 2108 | key binding | ||
| 2109 | --- -------\n") | ||
| 2110 | (help-mode))))) | 2105 | (help-mode))))) |
| 2111 | (let (scroll-help) | 2106 | (let (scroll-help) |
| 2112 | (save-selected-window | 2107 | (save-selected-window |
| 2113 | (select-window (get-buffer-window "*Quail-Help*")) | 2108 | (select-window (get-buffer-window "*Help*")) |
| 2114 | (if (eq this-command last-command) | 2109 | (if (eq this-command last-command) |
| 2115 | (if (< (window-end) (point-max)) | 2110 | (if (< (window-end) (point-max)) |
| 2116 | (scroll-up) | 2111 | (scroll-up) |