[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Placement of list within an interactive clause
From: |
Philip Kaludercic |
Subject: |
Re: Placement of list within an interactive clause |
Date: |
Thu, 14 Jul 2022 20:15:13 +0000 |
carlmarcos--- via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:
> Jul 14, 2022, 18:34 by help-gnu-emacs@gnu.org:
>
>>> Does it make difference where the list statement is placed?
>>>
>>
>> Write the code the way you find most convenient.
>> The syntax is:
>>
>> (defun FOO (...)
>> (interactive EXP)
>> ...)
>>
>> where EXP is *any* code whose evaluation returns a list of values.
>>
>> In that case an interactive call to FOO will behave like (apply #'FOO EXP)
>>
>> Stefan
>>
>
> When using ` (interactive (list (if condition (body))))', would the
> commands in the body of the if statement form part of the list? Does
> the same apply if using ` (let ' instead of ` (if ', where the body be
> part of the list entries?
The interactive expression evaluates to a list that is applied to the
function. So when you see
--8<---------------cut here---------------start------------->8---
(defun foo (...)
(interactive (list arg1 arg2 ... argn))
...)
--8<---------------cut here---------------end--------------->8---
you can think imagine that an interactive call does
--8<---------------cut here---------------start------------->8---
(apply #'foo (list arg1 arg2 ... argn))
--8<---------------cut here---------------end--------------->8---
- Placement of list within an interactive clause, carlmarcos, 2022/07/14
- Re: Placement of list within an interactive clause, Stefan Monnier, 2022/07/14
- Re: Placement of list within an interactive clause, carlmarcos, 2022/07/14
- Message not available
- Re: Placement of list within an interactive clause, carlmarcos, 2022/07/16
- Re: Placement of list within an interactive clause, Stefan Monnier, 2022/07/16
- Message not available
- Re: Placement of list within an interactive clause, carlmarcos, 2022/07/16
- Re: Placement of list within an interactive clause, Stefan Monnier, 2022/07/17
- RE: [External] : Re: Placement of list within an interactive clause, Drew Adams, 2022/07/14
- Re: Placement of list within an interactive clause, carlmarcos, 2022/07/14