[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#553: 23.0.60; Unknown button type `quail-keyboard-layout-button'

From: Juri Linkov
Subject: bug#553: 23.0.60; Unknown button type `quail-keyboard-layout-button'
Date: Sun, 13 Jul 2008 01:04:42 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu)

1. `emacs -Q'
2. `M-: (require 'help-mode) RET'
   or run any Help command that loads this mode
3. Activate an input method by C-\
4. Click `mouse-3' on the input method's indicator
   on the mode-line

It fills the *Help* buffer with the text only until
it tries to create a button, and fails with the error
"make-text-button: Unknown button type `quail-keyboard-layout-button'".

This is because `quail-help-init' fails to define new button types.
It currently has the form:

(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)
                        (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"))))

So it doesn't define two button types if `help-mode' is already loaded.

I guess it was done to define them only once, and not redefine on next
invocations.  Instead of checking for (featurep 'help-mode) it could
check if these buttons were already defined.  I can't find a function
like `button-defined-p' to do this.  But the following check seems to work:

(get 'quail-keyboard-layout-button 'button-category-symbol)

Juri Linkov

reply via email to

[Prev in Thread] Current Thread [Next in Thread]