bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#34506: 27.0.50: push-button bug with basic text-property button


From: Eli Zaretskii
Subject: bug#34506: 27.0.50: push-button bug with basic text-property button
Date: Sun, 17 Feb 2019 17:24:27 +0200

> From: Bob Weiner <rsw@gnu.org>
> Date: Sat, 16 Feb 2019 17:08:47 -0500
> 
> With point on a "Choose" button in a customize-group buffer, point is on
> a text-property button and (button-at (point)) returns a marker object
> rather than a button whose action is a marker object.  Thus, if one
> calls (push-button) at that location, it sends this marker object as the
> button argument to 'button-activate' which then triggers an error when
> it tries to funcall the button's action which is nil in this case.
> Shouldn't there be additional logic that checks if the button itself is
> a marker and then uses the button as the action in that case?
> 
> Related to this:  (button-type (button-at (point))) returns nil which seems
> to contradict the fact that button-at returns non-nil.
> 
> Am I missing things here or does button-activate need additional code?

button-activate and push-button already include that additional code,
but you are trying to invoke them on a kind of "button" that they
don't know how to handle.  The problem is that "button" is overloaded
here: buttons created by Customize are not of the kind supported by
functions from button.el, you need to invoke functions described in
widget.info instead.  The "text-property buttons" mentioned in the
documentation of button-at etc. are those created by make-text-button
and insert-text-button, not those created by Customize.

The ELisp manual hints on this at the beginning the parent node,
"Buttons".  Maybe that's not clear enough; patches to make that more
clear are welcome.  Other than that, I don't see a bug here.

Thanks.





reply via email to

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