GNU bug report logs - #553
23.0.60; Unknown button type `quail-keyboard-layout-button'

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> jurta.org>

Date: Sat, 12 Jul 2008 22:15:03 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 553 in the body.
You can then email your comments to 553 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#553; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> jurta.org>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: emacs-pretest-bug <at> gnu.org
Subject: 23.0.60; Unknown button type `quail-keyboard-layout-button'
Date: Sun, 13 Jul 2008 01:04:42 +0300
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)
					 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"))))

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
http://www.jurta.org/emacs/




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#553; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Chong Yidong <cyd <at> stupidchicken.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #10 received at 553 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Kenichi Handa  <handa <at> m17n.org>
Cc: Juri Linkov <juri <at> jurta.org>, 553 <at> debbugs.gnu.org
Subject: Re: 23.0.60; Unknown button type `quail-keyboard-layout-button'
Date: Thu, 21 Aug 2008 19:41:58 -0400
Hi Handa-san,

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

Do you remember why you wrote quail-help-init this way?  It seems
unnecessary; why not define the button types directly at the top level
of quail.el?




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#553; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> jurta.org>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #15 received at 553 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: Kenichi Handa <handa <at> m17n.org>, 553 <at> debbugs.gnu.org
Subject: Re: 23.0.60; Unknown button type `quail-keyboard-layout-button'
Date: Mon, 25 Aug 2008 18:52:09 +0300
> Do you remember why you wrote quail-help-init this way?  It seems
> unnecessary; why not define the button types directly at the top level
> of quail.el?

I don't know the reason of writing quail-help-init this way, but it seems
it was to not load `help-mode' after loading `quail.el'.  `help-mode' is
not necessary for quail's operations, so its loading should be postponed
for rare cases when the user needs to see the help buffer with keyboard
layouts.

-- 
Juri Linkov
http://www.jurta.org/emacs/




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#553; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Chong Yidong <cyd <at> stupidchicken.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #20 received at 553 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Juri Linkov <juri <at> jurta.org>
Cc: Kenichi Handa <handa <at> m17n.org>, 553 <at> debbugs.gnu.org
Subject: Re: 23.0.60; Unknown button type `quail-keyboard-layout-button'
Date: Tue, 26 Aug 2008 17:11:44 -0400
> > Do you remember why you wrote quail-help-init this way?  It seems
> > unnecessary; why not define the button types directly at the top level
> > of quail.el?
>
> I don't know the reason of writing quail-help-init this way, but it seems
> it was to not load `help-mode' after loading `quail.el'.  `help-mode' is
> not necessary for quail's operations, so its loading should be postponed
> for rare cases when the user needs to see the help buffer with keyboard
> layouts.

Right, but why do we have to put the button definitions inside
quail-help-init?  In other words, why not the following?

*** trunk/lisp/international/quail.el.~1.164.~	2008-05-06 00:18:15.000000000 -0400
--- trunk/lisp/international/quail.el	2008-08-26 17:09:39.000000000 -0400
***************
*** 2424,2450 ****
  	(insert ?\n))
        (insert ?\n))))
  
! (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"))))
  
  (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)
  	(mb enable-multibyte-characters)
  	(package-def
--- 2424,2447 ----
  	(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)
!   (require 'help-mode)
    (let ((help-xref-mule-regexp help-xref-mule-regexp-template)
  	(mb enable-multibyte-characters)
  	(package-def




Reply sent to Chong Yidong <cyd <at> stupidchicken.com>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to Juri Linkov <juri <at> jurta.org>:
bug acknowledged by developer. Full text and rfc822 format available.

Message #25 received at 553-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Juri Linkov <juri <at> jurta.org>
Cc: 553-done <at> debbugs.gnu.org
Subject: Re: 23.0.60; Unknown button type `quail-keyboard-layout-button'
Date: Fri, 05 Sep 2008 18:15:22 -0400
> I don't know the reason of writing quail-help-init this way, but it
> seems it was to not load `help-mode' after loading `quail.el'.
> `help-mode' is not necessary for quail's operations, so its loading
> should be postponed for rare cases when the user needs to see the help
> buffer with keyboard layouts.

I don't think it's a big deal to just load help-mode, so I changed
quail.el to do that.




Message #26 received at 553-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: 553-done <at> debbugs.gnu.org
Subject: Re: 23.0.60; Unknown button type `quail-keyboard-layout-button'
Date: Thu, 11 Sep 2008 03:05:15 +0300
>> I don't know the reason of writing quail-help-init this way, but it
>> seems it was to not load `help-mode' after loading `quail.el'.
>> `help-mode' is not necessary for quail's operations, so its loading
>> should be postponed for rare cases when the user needs to see the help
>> buffer with keyboard layouts.
>
> I don't think it's a big deal to just load help-mode, so I changed
> quail.el to do that.

Thanks, then it seems that (require 'help-mode) in `quail-help' is not
necessary since now quail.el has (require 'help-mode) at the top level.

-- 
Juri Linkov
http://www.jurta.org/emacs/




bug archived. Request was from Debbugs Internal Request <don <at> donarmstrong.com> to internal_control <at> emacsbugs.donarmstrong.com. (Thu, 09 Oct 2008 14:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 16 years and 313 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.