[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Ability to use a button to run interactive function
From: |
Marcin Borkowski |
Subject: |
Re: Ability to use a button to run interactive function |
Date: |
Mon, 28 Aug 2023 17:28:04 +0200 |
User-agent: |
mu4e 1.1.0; emacs 30.0.50 |
On 2023-08-28, at 16:34, 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") ))
Works for me. What did you do?
I evaled the defun first and then did M-x global-set-key.
Although, I'd probably use a hydra for things like that.
Best,
--
Marcin Borkowski
http://mbork.pl