[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Buttons in help buffer that displays contents of variables
From: |
Heime |
Subject: |
Re: Buttons in help buffer that displays contents of variables |
Date: |
Sat, 22 Jul 2023 23:13:26 +0000 |
------- Original Message -------
On Sunday, July 23rd, 2023 at 10:50 AM, Stephen Berman <stephen.berman@gmx.net>
wrote:
> On Sat, 22 Jul 2023 22:42:55 +0000 Heime heimeborgia@protonmail.com wrote:
>
> > ------- Original Message -------
> > On Sunday, July 23rd, 2023 at 10:28 AM, Stephen Berman
> > stephen.berman@gmx.net wrote:
> >
> > > On Sat, 22 Jul 2023 22:13:25 +0000 Heime heimeborgia@protonmail.com wrote:
> > >
> > > [...]
> > >
> > > > > > > > > > The error says the function my-action expects one argument,
> > > > > > > > > > but you
> > > > > > > > > > defined it with an empty argument list. If you don't want
> > > > > > > > > > to use the
> > > > > > > > > > argument, you can use `' as a placeholder for the required
> > > > > > > > > > argument,
> > > > > > > > > > which will be ignored by the byte compiler:
> > > > > > > > > >
> > > > > > > > > > (defun my-action ()
> > > > > > > > > > "Function to be executed when the button is clicked."
> > > > > > > > > > (interactive)
> > > > > > > > > > (message "%s" myvar))
> > > > > > > > > >
> > > > > > > > > > Steve Berman
> > > >
> > > > Do you know what the single argument is used for ?
> > >
> > > This is explained in the Info node `(elisp) Manipulating Buttons': Where
> > > a BUTTON parameter is specified, it means an object referring to a
> > > specific button, either an overlay (for overlay buttons), or a
> > > buffer-position or marker (for text property buttons). Such an object is
> > > passed as the first argument to a button’s invocation function when it is
> > > invoked. See also the function` button-activate' described in that node.
> > >
> > > Steve Berman
> >
> > What would be the actual object name passed to the function ?
>
>
> I'm not sure what you mean by "actual object name", but since the
> parameter is a local variable of the function, you can use any name for
> it you like, including, as noted above, the underscore `_' (which seems
> to have been removed by your mail program in the above citation), if you
> don't use it in the body of the function.
>
> Steve Berman
What does the button.el use as object to push to the action associated function
that would be sensible. Would it be "action" ?
- Re: Buttons in help buffer that displays contents of variables, (continued)
- Re: Buttons in help buffer that displays contents of variables, Stephen Berman, 2023/07/22
- Re: Buttons in help buffer that displays contents of variables, Heime, 2023/07/22
- Re: Buttons in help buffer that displays contents of variables, Stephen Berman, 2023/07/22
- Re: Buttons in help buffer that displays contents of variables, Heime, 2023/07/22
- Re: Buttons in help buffer that displays contents of variables, Stephen Berman, 2023/07/22
- Re: Buttons in help buffer that displays contents of variables, Heime, 2023/07/22
- Re: Buttons in help buffer that displays contents of variables, Heime, 2023/07/22
- Re: Buttons in help buffer that displays contents of variables, Stephen Berman, 2023/07/22
- Re: Buttons in help buffer that displays contents of variables, Heime, 2023/07/22
- Re: Buttons in help buffer that displays contents of variables, Stephen Berman, 2023/07/22
- Re: Buttons in help buffer that displays contents of variables,
Heime <=
- Re: Buttons in help buffer that displays contents of variables, Yuri Khan, 2023/07/23
- Re: Buttons in help buffer that displays contents of variables, Heime, 2023/07/23
- Re: Buttons in help buffer that displays contents of variables, Yuri Khan, 2023/07/23
- Re: Buttons in help buffer that displays contents of variables, Heime, 2023/07/23