From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Robert Weiner Newsgroups: gmane.emacs.bugs Subject: bug#34506: 27.0.50: push-button bug with basic text-property button Date: Sun, 17 Feb 2019 18:46:09 -0500 Message-ID: References: <83pnrql9p0.fsf@gnu.org> Reply-To: rswgnu@gmail.com Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000004e295105821f9e2d" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="228822"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34506@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 18 00:47:13 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gvW9R-000xPS-9l for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 Feb 2019 00:47:13 +0100 Original-Received: from localhost ([127.0.0.1]:47962 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvW9Q-0004Nm-CZ for geb-bug-gnu-emacs@m.gmane.org; Sun, 17 Feb 2019 18:47:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47477) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvW9K-0004Nf-Lf for bug-gnu-emacs@gnu.org; Sun, 17 Feb 2019 18:47:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvW9G-0004X6-V2 for bug-gnu-emacs@gnu.org; Sun, 17 Feb 2019 18:47:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52558) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gvW9F-0004WB-Py for bug-gnu-emacs@gnu.org; Sun, 17 Feb 2019 18:47:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gvW9F-00053b-LH for bug-gnu-emacs@gnu.org; Sun, 17 Feb 2019 18:47:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Weiner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Feb 2019 23:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34506 X-GNU-PR-Package: emacs Original-Received: via spool by 34506-submit@debbugs.gnu.org id=B34506.155044720519415 (code B ref 34506); Sun, 17 Feb 2019 23:47:01 +0000 Original-Received: (at 34506) by debbugs.gnu.org; 17 Feb 2019 23:46:45 +0000 Original-Received: from localhost ([127.0.0.1]:51839 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gvW8y-000535-G8 for submit@debbugs.gnu.org; Sun, 17 Feb 2019 18:46:44 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:33057) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gvW8v-00052t-U2 for 34506@debbugs.gnu.org; Sun, 17 Feb 2019 18:46:43 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:35635) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvW8q-0004LI-Nd for 34506@debbugs.gnu.org; Sun, 17 Feb 2019 18:46:36 -0500 Original-Received: from mail-lf1-f46.google.com ([209.85.167.46]:46324) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1gvW8q-00076M-Dz for 34506@debbugs.gnu.org; Sun, 17 Feb 2019 18:46:36 -0500 Original-Received: by mail-lf1-f46.google.com with SMTP id g12so1340681lfb.13 for <34506@debbugs.gnu.org>; Sun, 17 Feb 2019 15:46:36 -0800 (PST) X-Gm-Message-State: AHQUAubKaJWEDDegvIHEK/BZ4g7tur4P1ltQZp28D/qlFU5oktd7X3Ed BSYTLT/Yk20W3VC/ArNqJHMoZY2gdvl3LhqyHJ0= X-Google-Smtp-Source: AHgI3IaCe84i0L9LWdA/7Nn1JENyxBvM1AP9QUYv1FVgon1kZag0usfx/QIh7wO7EFJPr+taly4XQSp7+mC8y8dJEyE= X-Received: by 2002:ac2:4474:: with SMTP id y20mr11695479lfl.40.1550447195070; Sun, 17 Feb 2019 15:46:35 -0800 (PST) In-Reply-To: <83pnrql9p0.fsf@gnu.org> X-Gmail-Original-Message-ID: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:155482 Archived-At: --0000000000004e295105821f9e2d Content-Type: text/plain; charset="UTF-8" On Sun, Feb 17, 2019 at 10:24 AM Eli Zaretskii wrote: > > From: Bob Weiner > > 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. > I really don't fully understand what you are saying here. There is a section in widget.info which describes use of the (push-button) function which is defined in button.el, so although I understand you are saying there are two different types of buttons, it seems like they are connected. Maybe the custom widgets use text-property buttons. If you could, for each of the two types of buttons, just show code that finds the button at point and then activates it, so I can see the difference clearly. That would be most helpful. And what about (button-type (button-at (point))) returning nil when button-at returns non-nil. Both of these functions operate on push-buttons as the button.el code reflects, right? If so, then that should be a bug. If not, then it could use some explanation. Thanks, Bob --0000000000004e295105821f9e2d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sun, Feb 17, 2019 at 10:24 AM Eli Zaretskii <eliz@gnu.org> wrote:
> = From: Bob Weiner <rsw@g= nu.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.=C2=A0 Thus, if o= ne
> calls (push-button) at that location, it sends this marker object as t= he
> button argument to 'button-activate' which then triggers an er= ror 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 itse= lf is
> a marker and then uses the button as the action in that case?
>
> Related to this:=C2=A0 (button-type (button-at (point))) returns nil w= hich 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.=C2=A0 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.=C2=A0 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.

I really don't fully understand what you are saying here.
=
Ther= e is a section in widget.info which desc= ribes use of the (push-button)
function which is defined in button.el, so = although I
understand you are saying there are two different types
of but= tons, it seems like they are connected.=C2=A0 Maybe
the custom widgets use= text-property buttons.

If you could, for each of the two types of b= uttons,
just show code that finds the button at point and then
activates = it, so I can see the difference clearly.=C2=A0 That
would be most helpful.=

And what about (button-type (button-at (point))) returning
nil whe= n button-at returns non-nil.=C2=A0 Both of these functions
operate on pus= h-buttons as the button.el code reflects, right?
If so, then that should b= e a bug.=C2=A0 If not, then it could use
some explanation.

Thanks,<= /div>

Bob

--0000000000004e295105821f9e2d--