all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: rswgnu@gmail.com
Cc: 34506@debbugs.gnu.org
Subject: bug#34506: 27.0.50: push-button bug with basic text-property button
Date: Mon, 18 Feb 2019 17:47:32 +0200	[thread overview]
Message-ID: <831s45ksiz.fsf@gnu.org> (raw)
In-Reply-To: <CA+OMD9i2QyJYGkeS3o5LJJL7TayJSBiPb+P0oPNi5uR3OrJgOg@mail.gmail.com> (message from Robert Weiner on Sun, 17 Feb 2019 18:46:09 -0500)

> From: Robert Weiner <rsw@gnu.org>
> 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.





  reply	other threads:[~2019-02-18 15:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-16 22:08 bug#34506: 27.0.50: push-button bug with basic text-property button Bob Weiner
2019-02-17 15:24 ` Eli Zaretskii
2019-02-17 23:46   ` Robert Weiner
2019-02-18 15:47     ` Eli Zaretskii [this message]
2019-02-18 16:56       ` Robert Weiner
2019-02-18 17:36         ` Eli Zaretskii
2019-02-18 20:52         ` Basil L. Contovounesios
2019-02-18 20:51       ` Basil L. Contovounesios
2019-02-18 22:54         ` Robert Weiner
2019-02-19  3:08           ` Basil L. Contovounesios
2019-02-19  3:29         ` Eli Zaretskii
2019-02-19 15:26           ` Basil L. Contovounesios
2019-02-20  5:22             ` Robert Weiner
2019-02-25  2:40               ` Basil L. Contovounesios
2019-03-02 12:34                 ` Eli Zaretskii
2019-04-07  3:14                   ` Basil L. Contovounesios

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=831s45ksiz.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=34506@debbugs.gnu.org \
    --cc=rswgnu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.