GNU bug report logs - #12817
24.2; The button library does not work on the header line

Previous Next

Package: emacs;

Reported by: Damien Cassou <damien.cassou <at> gmail.com>

Date: Tue, 6 Nov 2012 17:05:01 UTC

Severity: normal

Found in version 24.2

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Damien Cassou <damien.cassou <at> gmail.com>
Cc: 12817 <at> debbugs.gnu.org
Subject: bug#12817: 24.2; The button library does not work on the header line
Date: Tue, 04 Dec 2012 15:19:46 -0500
> the button library does not work if a button is created on the header-line:

>   (require 'button)
>   (defun my-button-action (button)
>     (message "HERE I AM"))
>   (define-button-type 'my-button-type
>     'action #'my-button-action
>     'follow-link t)
>   (setq test-button (copy-sequence "CLICK ME"))
>   (make-text-button test-button nil
>                     'type 'my-button-type)
>   (setq header-line-format test-button)

> After evaluating these lines, a button appear with the text "CLICK ME"
> in blue and underlined. But clicking this button does nothing. I was
> expecting that clicking the button would trigger 'my-button-action and
> display the message "HERE I AM".

Sounds like a reasonable expectation.

> There is a library that makes 'button work on header-line: 
> https://raw.github.com/tarsius/header-button/master/header-button.el

Would someone be able to turn the above code into a patch to button.el
that makes your sample code work (i.e. make `make-text-button' work in
a header, instead of introducing an ad-hoc `header-button-format')?


        Stefan


PS: BTW, the "follow-link does not work here" comment points at
a misfeature of follow-link, indeed.  I think `follow-link' should be
implemented in function-key-map rather than in mouse-drag-region.




This bug report was last modified 12 years and 229 days ago.

Previous Next


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