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

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

Re: Ability to use a button to run interactive function


From: Heime
Subject: Re: Ability to use a button to run interactive function
Date: Mon, 28 Aug 2023 16:33:57 +0000

------- Original Message -------
On Tuesday, August 29th, 2023 at 2:55 AM, Stephen Berman 
<stephen.berman@gmx.net> wrote:

> On Mon, 28 Aug 2023 14:34:23 +0000 Heime heimeborgia@protonmail.com wrote:
> 
> > The following function does not allow me to call it via a button. Would
> > this be possible, whilst also be allowed to call the function interactively
> > using 'M-x maces-snapshot' ?
> > 
> > (defun maces-snapshot ()
> > "Prints information about how to install emacs."
> > (interactive)
> > 
> > (with-help-window (help-buffer)
> > 
> > (insert-button "[F5]" 'action 'action-snapshot
> > 'follow-link t)
> > (insert " A Snapshot Repository \n")
> > 
> > (insert-button "[B5]" 'action 'action-snapshot
> > 'follow-link t)
> > (insert " Obtaining a Snapshot Repository with Git \n") ))
> 
> 
> Yes, give maces-snapshot an optional argument:
> 
> (defun maces-snapshot (&optional button)
> ...
> 
> Steve Berman

Amazing ! Had thought that function with arguments could not be called 
interactively.




reply via email to

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