[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to make a non-interactive function into a command?
From: |
mbork |
Subject: |
How to make a non-interactive function into a command? |
Date: |
Wed, 14 May 2025 08:26:37 +0200 |
Hi all,
I know about the `interactive-form' symbol property, but for some reason
I can't make it work. I tried this in `emacs -Q':
--8<---------------cut here---------------start------------->8---
(defun my-function ()
"1-2-3-testing"
(message "Hello!"))
(put 'my-function 'interactive-form '(interactive))
--8<---------------cut here---------------end--------------->8---
but I keep getting the error "Found an 'interactive-form' property!"
when trying to call `my-function' via `M-x'.
It looks like this error message was introduced ~3 years ago in commit
bffc4cb39dc7b83fc4a1bffd23eeed2774b79444:
--8<---------------cut here---------------start------------->8---
New generic function `oclosure-interactive-form`
[...]
* src/eval.c (Fcommandp): Delegate to `interactive-form` if the arg is
an OClosure.
[...]
--8<---------------cut here---------------end--------------->8---
Sadly, I don't understand that commit.
Any ideas how to make `interactive-form' property work?
--
Marcin Borkowski
https://mbork.pl
https://crimsonelevendelightpetrichor.net/
- How to make a non-interactive function into a command?,
mbork <=
- Re: How to make a non-interactive function into a command?, Stefan Monnier, 2025/05/14
- Re: How to make a non-interactive function into a command?, mbork, 2025/05/14
- Re: How to make a non-interactive function into a command?, Ship Mints, 2025/05/14
- Re: How to make a non-interactive function into a command?, mbork, 2025/05/15
- Re: How to make a non-interactive function into a command?, Ship Mints, 2025/05/15
- Re: How to make a non-interactive function into a command?, mbork, 2025/05/16
- Re: How to make a non-interactive function into a command?, Ship Mints, 2025/05/16
- Re: How to make a non-interactive function into a command?, mbork, 2025/05/16
- Re: How to make a non-interactive function into a command?, Stefan Monnier, 2025/05/16
- Re: How to make a non-interactive function into a command?, Stefan Monnier, 2025/05/15