changeset 82284:65186e6b080e

Wrap (require 'help-mode) by eval-when-compile. (quail-help-init): New function. (quail-help): Call quail-help-init. (quail-store-decode-map-key): Change it to a function.
author Kenichi Handa <handa@m17n.org>
date Mon, 06 Aug 2007 01:01:20 +0000
parents 3133b68f89f1
children e6a22becd0a3
files lisp/international/quail.el
diffstat 1 files changed, 16 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/quail.el	Sun Aug 05 21:51:30 2007 +0000
+++ b/lisp/international/quail.el	Mon Aug 06 01:01:20 2007 +0000
@@ -55,7 +55,7 @@
 
 ;;; Code:
 
-(require 'help-mode)
+(eval-when-compile (require 'help-mode))
 
 (defgroup quail nil
   "Quail: multilingual input method."
@@ -2431,22 +2431,27 @@
 	(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"))
+(defun quail-help-init ()
+  (unless (featurep 'help-mode)
+    (require 'help-mode)
+    (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"))
+    (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)
+  (quail-help-init)
   (let ((help-xref-mule-regexp help-xref-mule-regexp-template)
 	(default-enable-multibyte-characters enable-multibyte-characters)
 	(package-def
@@ -2629,7 +2634,7 @@
 ;; it is not yet stored.  As a result, the element is a string or a
 ;; list of strings.
 
-(defsubst quail-store-decode-map-key (table char key)
+(defun quail-store-decode-map-key (table char key)
   (let ((elt (aref table char)))
     (if elt
 	(if (consp elt)