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: Mon, 18 Feb 2019 17:54:06 -0500 Message-ID: References: <83pnrql9p0.fsf@gnu.org> <831s45ksiz.fsf@gnu.org> <875ztgrfb3.fsf@tcd.ie> Reply-To: rswgnu@gmail.com Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000000bf070058233026d" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="255163"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34506@debbugs.gnu.org To: "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 18 23:55:17 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 1gvroj-0014H6-2c for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 Feb 2019 23:55:17 +0100 Original-Received: from localhost ([127.0.0.1]:37922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvroh-0002Ln-Tu for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 Feb 2019 17:55:15 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:38508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvroW-0002L4-Lz for bug-gnu-emacs@gnu.org; Mon, 18 Feb 2019 17:55:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvroV-0005Mb-Nr for bug-gnu-emacs@gnu.org; Mon, 18 Feb 2019 17:55:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54124) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gvroV-0005MS-Jx for bug-gnu-emacs@gnu.org; Mon, 18 Feb 2019 17:55:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gvroV-0003Fd-FV for bug-gnu-emacs@gnu.org; Mon, 18 Feb 2019 17:55:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Weiner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Feb 2019 22:55:03 +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.155053049212452 (code B ref 34506); Mon, 18 Feb 2019 22:55:03 +0000 Original-Received: (at 34506) by debbugs.gnu.org; 18 Feb 2019 22:54:52 +0000 Original-Received: from localhost ([127.0.0.1]:53404 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gvroK-0003El-3W for submit@debbugs.gnu.org; Mon, 18 Feb 2019 17:54:52 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52229) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gvroH-0003ER-Gc for 34506@debbugs.gnu.org; Mon, 18 Feb 2019 17:54:50 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:53791) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvro3-00054K-Gr for 34506@debbugs.gnu.org; Mon, 18 Feb 2019 17:54:40 -0500 Original-Received: from mail-lf1-f45.google.com ([209.85.167.45]:35579) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1gvro2-0005mY-Be for 34506@debbugs.gnu.org; Mon, 18 Feb 2019 17:54:35 -0500 Original-Received: by mail-lf1-f45.google.com with SMTP id v7so13499213lfd.2 for <34506@debbugs.gnu.org>; Mon, 18 Feb 2019 14:54:34 -0800 (PST) X-Gm-Message-State: AHQUAuYw99Q73z01CMcPVqZ9110GFI6m0+aMTQFQcT4LDb18RFzDvZGo UmPrni/v9RXcpK5LEXv4cZNZtdYvZsRYUk/zAyk= X-Google-Smtp-Source: AHgI3IZDA+EGTrVhaqCaPlbQCBRVtbwkVJCIuBzpg7DRNhrTWDtLJselk1QQpKoWPbRl1ZcHkbuXW+qWvpXN+1oBeUo= X-Received: by 2002:a19:ee13:: with SMTP id g19mr14927795lfb.72.1550530472831; Mon, 18 Feb 2019 14:54:32 -0800 (PST) In-Reply-To: <875ztgrfb3.fsf@tcd.ie> 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:155525 Archived-At: --0000000000000bf070058233026d Content-Type: text/plain; charset="UTF-8" On Mon, Feb 18, 2019 at 3:51 PM Basil L. Contovounesios wrote: > Eli Zaretskii writes: > > >> From: Robert Weiner > >> Date: Sun, 17 Feb 2019 18:46:09 -0500 > >> Cc: 34506@debbugs.gnu.org > >> > >> 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. > > > > button-type requires a button as an argument, whereas button-at is > > documented to return a marker for text-buttons. So you cannot safely > > invoke button-type if the button at point might be of the text-button > > type. > > Buffer positions, markers, and overlays all qualify as "buttons", so > button-type works with both text- and overlay-buttons (but not widgets). > But as I think I noted in my first message, my recollection is that button-type returned nil when given a marker value returned from button-at. Since widgets use text-properties, button-at on a widget can return a non-nil value, so to say that widgets and buttons are unrelated ignores the programming API. Maybe the solution is to add a more opaque programming abstraction atop each type so that they don't expose their underlying implementations and cause programming errors. > > So I'm guessing what you meant is "you cannot safely invoke button-type > if the button at point might be a widget rather than a button". > Yes, again noting that widget documentation specifically mentions push-buttons (push-button is the function used to activate buttons). This negates the idea that the two constructs are wholly independent of each other. Regards, Bob --0000000000000bf070058233026d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Feb 18, 2019 at 3:51 PM Basil L. Contovounesios <contovob@tcd.ie> wrote:
Eli Zaretskii <eliz@gnu.org> writes:

>> From: Robert Weiner <rsw@gnu.org>
>> Date: Sun, 17 Feb 2019 18:46:09 -0500
>> Cc: 345= 06@debbugs.gnu.org
>>
>> And what about (button-type (button-at (point))) returning
>> nil when button-at returns non-nil.=C2=A0 Both of these functions<= br> >> operate on push-buttons as the button.el code reflects, right?
>> If so, then that should be a bug.=C2=A0 If not, then it could use<= br> >> some explanation.
>
> button-type requires a button as an argument, whereas button-at is
> documented to return a marker for text-buttons.=C2=A0 So you cannot sa= fely
> invoke button-type if the button at point might be of the text-button<= br> > type.

Buffer positions, markers, and overlays all qualify as "buttons",= so
button-type works with both text- and overlay-buttons (but not widgets).

But as I think I noted in my first message, my rec= ollection
is that button-type returned nil when given a marker value
=
retu= rned from button-at.=C2=A0 Since widgets use text-properties,
button-at on= a widget can return a non-nil value, so to say that
widgets and buttons a= re unrelated ignores the programming API.
Maybe the solution is to add a m= ore opaque programming abstraction
atop each type so that they don't = expose their underlying implementations
and cause programming errors.

So I'm guessing what you meant is "you cannot safely invoke button= -type
if the button at point might be a widget rather than a button".

Yes, again noting that widget documentation specifical= ly mentions push-buttons
(push-button is the function used to activate but= tons).=C2=A0 This negates the idea
that the two constructs are wholly ind= ependent of each other.

Regards,

Bob
--0000000000000bf070058233026d--