(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.
This commit is contained in:
parent
a399ef7b3a
commit
6c7b13cf7e
1 changed files with 39 additions and 44 deletions
|
@ -1261,7 +1261,7 @@ The returned value is a Quail map specific to KEY."
|
||||||
(quail-terminate-translation)))
|
(quail-terminate-translation)))
|
||||||
|
|
||||||
(defun quail-self-insert-command ()
|
(defun quail-self-insert-command ()
|
||||||
"Add the typed character to the key for translation."
|
"Translate the typed character to by the current Quail map."
|
||||||
(interactive "*")
|
(interactive "*")
|
||||||
(setq quail-current-key
|
(setq quail-current-key
|
||||||
(concat quail-current-key (char-to-string last-command-event)))
|
(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')."
|
||||||
(select-window (active-minibuffer-window))
|
(select-window (active-minibuffer-window))
|
||||||
(exit-minibuffer))))))
|
(exit-minibuffer))))))
|
||||||
|
|
||||||
(defun quail-help ()
|
(defun quail-help (&optional package)
|
||||||
"Show brief description of the current Quail package."
|
"Show brief description of the current Quail package.
|
||||||
|
Optional 2nd arg PACKAGE specifies the alternative Quail package to describe."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((package quail-current-package))
|
(or package
|
||||||
(with-output-to-temp-buffer "*Quail-Help*"
|
(setq package quail-current-package))
|
||||||
|
(let ((help-xref-mule-regexp help-xref-mule-regexp-template))
|
||||||
|
(with-output-to-temp-buffer "*Help*"
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(set-buffer standard-output)
|
(set-buffer standard-output)
|
||||||
(let ((quail-current-package package))
|
(setq quail-current-package package)
|
||||||
(insert "Quail input method (name:"
|
(insert "Quail input method (name:"
|
||||||
(quail-name)
|
(quail-name)
|
||||||
", mode line indicator:["
|
", mode line indicator:["
|
||||||
(quail-title)
|
(quail-title)
|
||||||
"])\n---- Documentation ----\n"
|
"])\n\n---- Documentation ----\n"
|
||||||
(quail-docstring))
|
(quail-docstring))
|
||||||
(newline)
|
(newline)
|
||||||
(if (quail-show-layout) (quail-show-kbd-layout))
|
(if (quail-show-layout) (quail-show-kbd-layout))
|
||||||
(quail-help-insert-keymap-description
|
(quail-help-insert-keymap-description
|
||||||
(quail-translation-keymap)
|
(quail-translation-keymap)
|
||||||
"--- Key bindings (while translating) ---
|
(format "--- Key bindings%s ---\n"
|
||||||
key binding
|
(if (quail-conversion-keymap)
|
||||||
--- -------\n")
|
" (while translating)"
|
||||||
(if (quail-conversion-keymap)
|
"")))
|
||||||
(quail-help-insert-keymap-description
|
(if (quail-conversion-keymap)
|
||||||
(quail-conversion-keymap)
|
(quail-help-insert-keymap-description
|
||||||
"--- Key bindings (while converting) ---
|
(quail-conversion-keymap)
|
||||||
key binding
|
"\n--- Key bindings (while converting) ---\n"))
|
||||||
--- -------\n"))
|
(setq quail-current-package nil)
|
||||||
(help-mode))))))
|
(help-setup-xref (list #'quail-help package)
|
||||||
|
(interactive-p))))))
|
||||||
|
|
||||||
(defun quail-help-insert-keymap-description (keymap &optional header)
|
(defun quail-help-insert-keymap-description (keymap &optional header)
|
||||||
(let (from to)
|
(let (pos)
|
||||||
(if header
|
(if header
|
||||||
(insert header))
|
(insert header))
|
||||||
(save-excursion
|
(setq pos (point))
|
||||||
(save-window-excursion
|
(insert (substitute-command-keys "\\{keymap}"))
|
||||||
(let ((overriding-terminal-local-map keymap))
|
(goto-char pos)
|
||||||
(describe-bindings))
|
(while (search-forward "quail-other-command" nil 'move)
|
||||||
(set-buffer "*Help*")
|
(delete-region (line-beginning-position) (1+ (line-end-position))))))
|
||||||
(goto-char (point-min))
|
|
||||||
(forward-line 4)
|
|
||||||
(setq from (point))
|
|
||||||
(search-forward "Global Bindings:" nil 'move)
|
|
||||||
(beginning-of-line)
|
|
||||||
(setq to (point))))
|
|
||||||
(insert-buffer-substring "*Help*" from to)))
|
|
||||||
|
|
||||||
(defun quail-show-kbd-layout ()
|
(defun quail-show-kbd-layout ()
|
||||||
"Show keyboard layout with key tops of multilingual characters."
|
"Show keyboard layout with key tops of multilingual characters."
|
||||||
|
@ -2098,19 +2095,17 @@ key binding
|
||||||
(format "Translating key sequence %S by input method %S.\n"
|
(format "Translating key sequence %S by input method %S.\n"
|
||||||
quail-current-key (quail-name))
|
quail-current-key (quail-name))
|
||||||
keymap (quail-translation-keymap)))
|
keymap (quail-translation-keymap)))
|
||||||
(with-output-to-temp-buffer "*Quail-Help*"
|
(with-output-to-temp-buffer "*Help*"
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(set-buffer standard-output)
|
(set-buffer standard-output)
|
||||||
(insert state-msg)
|
(insert state-msg)
|
||||||
(quail-help-insert-keymap-description
|
(quail-help-insert-keymap-description
|
||||||
keymap
|
keymap
|
||||||
"-----------------------
|
"-----------------------\n")
|
||||||
key binding
|
|
||||||
--- -------\n")
|
|
||||||
(help-mode)))))
|
(help-mode)))))
|
||||||
(let (scroll-help)
|
(let (scroll-help)
|
||||||
(save-selected-window
|
(save-selected-window
|
||||||
(select-window (get-buffer-window "*Quail-Help*"))
|
(select-window (get-buffer-window "*Help*"))
|
||||||
(if (eq this-command last-command)
|
(if (eq this-command last-command)
|
||||||
(if (< (window-end) (point-max))
|
(if (< (window-end) (point-max))
|
||||||
(scroll-up)
|
(scroll-up)
|
||||||
|
|
Loading…
Add table
Reference in a new issue