From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#34506: 27.0.50: push-button bug with basic text-property button Date: Mon, 18 Feb 2019 17:47:32 +0200 Message-ID: <831s45ksiz.fsf@gnu.org> References: <83pnrql9p0.fsf@gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="167558"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34506@debbugs.gnu.org To: rswgnu@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 18 16:48:14 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 1gvl9S-000hQy-1t for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 Feb 2019 16:48:14 +0100 Original-Received: from localhost ([127.0.0.1]:60936 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvl9R-0006CT-4P for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 Feb 2019 10:48:13 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvl9H-0006CA-QM for bug-gnu-emacs@gnu.org; Mon, 18 Feb 2019 10:48:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvl9G-000482-Tf for bug-gnu-emacs@gnu.org; Mon, 18 Feb 2019 10:48:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53811) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gvl9G-00047s-PC for bug-gnu-emacs@gnu.org; Mon, 18 Feb 2019 10:48:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gvl9G-0005lU-Ia for bug-gnu-emacs@gnu.org; Mon, 18 Feb 2019 10:48:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Feb 2019 15:48: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.155050486022128 (code B ref 34506); Mon, 18 Feb 2019 15:48:02 +0000 Original-Received: (at 34506) by debbugs.gnu.org; 18 Feb 2019 15:47:40 +0000 Original-Received: from localhost ([127.0.0.1]:53092 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gvl8u-0005kn-5P for submit@debbugs.gnu.org; Mon, 18 Feb 2019 10:47:40 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42961) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gvl8p-0005kY-Us for 34506@debbugs.gnu.org; Mon, 18 Feb 2019 10:47:38 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:45693) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvl8j-0003ol-R6; Mon, 18 Feb 2019 10:47:30 -0500 Original-Received: from [176.228.60.248] (port=1095 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gvl8h-0005Yd-VV; Mon, 18 Feb 2019 10:47:29 -0500 In-reply-to: (message from Robert Weiner on Sun, 17 Feb 2019 18:46:09 -0500) 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:155493 Archived-At: > From: Robert Weiner > Date: Sun, 17 Feb 2019 18:46:09 -0500 > Cc: 34506@debbugs.gnu.org > > 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. I'm saying that a "button" created by Customize is radically different from "buttons" that button.el functions can handle. They are different objects, and it's unfortunate that both kinds are named the same. > There is a section in widget.info which describes use of the (push-button) > function which is defined in button.el No, push-button described in widget.info is a type of widget, not a function. Again, the same name used for two very different things. > Maybe the custom widgets use text-property buttons. Custom widget button do indeed use text properties, but those properties are entirely different from the properties used by text-buttons created by button.el. You can see that yourself by using the describe-text-properties command with point on each type of button. > 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. If you type "C-h c RET" on a button in a Customize buffer, you will see that RET invokes Custom-newline there -- this is the way to "push" the button widgets that Custom uses. By contrast, if you do the same on a button created by button.el, like a hyperlink in the *Help* buffer, you will see that RET invokes the command push-button there, a different command. These are the two ways of pushing these two different kinds of buttons. > 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. IOW, the text-button is not an object, it is a place in the buffer where the button starts.