From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#34506: 27.0.50: push-button bug with basic text-property button Date: Tue, 19 Feb 2019 03:08:33 +0000 Message-ID: <87zhqslbke.fsf@tcd.ie> References: <83pnrql9p0.fsf@gnu.org> <831s45ksiz.fsf@gnu.org> <875ztgrfb3.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="44649"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: rswgnu@gmail.com, 34506@debbugs.gnu.org To: Robert Weiner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 19 04:09:20 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 1gvvmX-000BTW-Ny for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Feb 2019 04:09:17 +0100 Original-Received: from localhost ([127.0.0.1]:40477 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvvmW-0006Tu-Q8 for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 Feb 2019 22:09:16 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvvmM-0006TE-Vh for bug-gnu-emacs@gnu.org; Mon, 18 Feb 2019 22:09:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvvmL-0004pf-3r for bug-gnu-emacs@gnu.org; Mon, 18 Feb 2019 22:09:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54218) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gvvmJ-0004pH-SU for bug-gnu-emacs@gnu.org; Mon, 18 Feb 2019 22:09:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gvvmI-0005Hz-1h for bug-gnu-emacs@gnu.org; Mon, 18 Feb 2019 22:09:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Feb 2019 03:09:02 +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.155054572620290 (code B ref 34506); Tue, 19 Feb 2019 03:09:02 +0000 Original-Received: (at 34506) by debbugs.gnu.org; 19 Feb 2019 03:08:46 +0000 Original-Received: from localhost ([127.0.0.1]:53499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gvvm1-0005HA-IV for submit@debbugs.gnu.org; Mon, 18 Feb 2019 22:08:45 -0500 Original-Received: from mail-ed1-f51.google.com ([209.85.208.51]:41022) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gvvly-0005Gn-1i for 34506@debbugs.gnu.org; Mon, 18 Feb 2019 22:08:43 -0500 Original-Received: by mail-ed1-f51.google.com with SMTP id x7so15462181eds.8 for <34506@debbugs.gnu.org>; Mon, 18 Feb 2019 19:08:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=DfmhLx959grlGFATAbnMLMalwpB9VD3b1MjWIq+GYos=; b=LGEtd4A6AMW+Qm810veTIsCNOJL+vqhY6VLB2a/gaA8Pr5/0+tZLgcrv09uN76WAR0 NBIuHTD/CeTRzlm9Yt3NopFlm1YCMDc3cdeDF1bqO4/r+5xJ4VKyW017HYru7XQfSE/k h0ZkwfpWTj6GoL3diw4outUvSRTI+tKaOGGUjlE5cTs5+rAKDgq17OXIsaU4+hKhb8R5 op33NNF+BCgnhhIAGck6iCIXZKHnf5hMUgiPnbu83/jOlwibNIPcnTYHrhGggp7TAwhD eLHx5tW8I7B1uo9xuUMKJQdEZwOIEVksrj+Cw2c5z4LNvK0dSANefsFD1J1lIFeIgdvq mZJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=DfmhLx959grlGFATAbnMLMalwpB9VD3b1MjWIq+GYos=; b=ANxDTUslzx0bdiSkH8W89vyeyhXIPLxuKmSQCnw1e8V3lNny7ErNZoP+QEpTBuXEmh 45ns6Ud8PJPyS/0CnhcYPCk9igreoOwjPTdEmvsJlkcQS94Vr4MzcPaoHJC8Dgkcrav3 PS3nK//OGl4T9j2XXzTF/7thvQbSRa7XpuLSJNnuGIBL9uytutt7UVIQ5JvDBca1ANJF ZqwOmCyk1gIyLEmYMv8RIvcp4+BYQZjW5NVlZVjhoiTGB4/igi4ur456lG2sU3MGl47Q Q4H2GKp/2JJLFG4WsQTfQoWrtcTDyo47rIHY8NTfBIb9DkIGs5lvPuyrhijFISRBBvOj KGAA== X-Gm-Message-State: AHQUAuZqsdiTY9+nWvFkP9AQKAn3dwtBLwXyaMUh3l6n5oKkd4/TTq6W ruy4i2KRo83fkEg5LGVgwfLqzQ== X-Google-Smtp-Source: AHgI3IbZGVx7bzmwLqVyIu+b9yWWG3lGPX0+YWuke2hLZNO361GsQaa+XT1tkHQYylEF0bIpbGfIeg== X-Received: by 2002:a17:906:3055:: with SMTP id d21mr18758062ejd.211.1550545716140; Mon, 18 Feb 2019 19:08:36 -0800 (PST) Original-Received: from localhost ([2a02:8084:20e2:c380:20c2:134e:4f3a:683a]) by smtp.gmail.com with ESMTPSA id o37sm4590167edc.32.2019.02.18.19.08.34 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 18 Feb 2019 19:08:35 -0800 (PST) In-Reply-To: (Robert Weiner's message of "Mon, 18 Feb 2019 17:54:06 -0500") 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:155534 Archived-At: Robert Weiner writes: > 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. I think what's confusing you is that button-at returns a marker even when there is no button at point. If either of the following two expressions evaluates to nil, then there is no button at point: (button-type (button-at (point))) (button-type (point)) If there is something that *looks* like a button at point, yet these expressions evaluate to nil, then you're probably looking at a widget instead. > Since widgets use text-properties, AFAICT Customize widgets use overlays, not text properties. I concluded this by comparing the results of (text-properties-at (point)) and (overlays-at (point)) with point at a Customize button. > button-at on a widget can return a non-nil value, so to say that > widgets and buttons are unrelated ignores the programming API. Again, that button-at returns a marker for a widget is a coincidence, not part of either library's API. Last time I read/skimmed the relevant manuals I was not given the impression that these libraries were related, but suggestions for clarification of their text is always welcome. > 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. Can you please elaborate? I don't see how either library's implementation is exposed beyond what is documented in its respective manual. > 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). push-button is indeed a button.el function used to activate buttons, but this has nothing to do with the push-button widget type, which is documented under '(widget) Introduction' and '(widget) push-button'. > This negates the idea that the two constructs are wholly independent > of each other. I hope I have managed to convince you otherwise. -- Basil