help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Buttons in help buffer that displays contents of variables


From: Stephen Berman
Subject: Re: Buttons in help buffer that displays contents of variables
Date: Sun, 23 Jul 2023 00:28:33 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]