# HG changeset patch # User Richard M. Stallman # Date 1006714384 0 # Node ID f2e8fb1e19285a948cb1d9fc1a185b236f65813a # Parent 77dd7bf4d860ca2889e7fa03eb784ea08de30609 (quail-keyboard-layout-button): Define button type. (quail-keyboard-customize-button): Likewise. (quail-help): Use those button types. Require `help-mode'. Avoid altering the argument `package'. diff -r 77dd7bf4d860 -r f2e8fb1e1928 lisp/international/quail.el --- a/lisp/international/quail.el Sun Nov 25 18:49:03 2001 +0000 +++ b/lisp/international/quail.el Sun Nov 25 18:53:04 2001 +0000 @@ -2395,21 +2395,34 @@ (insert ?\n)) (insert ?\n)))) +(define-button-type 'quail-keyboard-layout-button + :supertype 'help-xref + 'help-function '(lambda (layout) + (help-setup-xref `(quail-keyboard-layout-button ,layout) nil) + (quail-show-keyboard-layout layout)) + 'help-echo (purecopy "mouse-2, RET: show keyboard layout")) + +(define-button-type 'quail-keyboard-customize-button + :supertype 'help-customize-variable + 'help-echo (purecopy "mouse-2, RET: customize keyboard layout")) + (defun quail-help (&optional package) "Show brief description of the current Quail package. Optional arg PACKAGE specifies the name of alternative Quail package to describe." (interactive) - (if package - (setq package (assoc package quail-package-alist)) - (setq package quail-current-package)) + (require 'help-mode) (let ((help-xref-mule-regexp help-xref-mule-regexp-template) - (default-enable-multibyte-characters enable-multibyte-characters)) + (default-enable-multibyte-characters enable-multibyte-characters) + (package-def + (if package + (assoc package quail-package-alist) + quail-current-package))) ;; At first, make sure that the help buffer has window. (help-setup-xref (list #'quail-help package) (interactive-p)) (with-output-to-temp-buffer (help-buffer) (with-current-buffer standard-output - (setq quail-current-package package))) + (setq quail-current-package package-def))) ;; Then, insert text in the help buffer while paying attention to ;; the width of the frame in which the buffer displayed. (with-current-buffer (help-buffer) @@ -2445,8 +2458,8 @@ Assuming that your actual keyboard has the `") (help-insert-xref-button quail-keyboard-layout-type - #'quail-show-keyboard-layout quail-keyboard-layout-type - "mouse-2, RET: show this layout") + 'quail-keyboard-layout-button + quail-keyboard-layout-type) (insert "' layout, translation results in the following \"virtual\" keyboard layout: ") @@ -2456,8 +2469,7 @@ `") (help-insert-xref-button "standard" - #'quail-show-keyboard-layout "standard" - "mouse-2, RET: show this layout") + 'quail-keyboard-layout-button "standard") (insert "', the \"virtual\" keyboard you get with this input method will be rearranged in the same way. @@ -2468,8 +2480,7 @@ ") (help-insert-xref-button "[customize keyboard layout]" - #'customize-variable 'quail-keyboard-layout-type - "mouse-2, RET: set keyboard layout type") + 'quail-keyboard-customize-button 'quail-keyboard-layout-type) (insert "\n")) ;; Show key sequences.