[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Making `interactive' conditional
From: |
Clément Pit--Claudel |
Subject: |
Re: Making `interactive' conditional |
Date: |
Mon, 11 Jan 2016 21:14:44 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 |
On 01/10/2016 04:02 AM, Lars Magne Ingebrigtsen wrote:
> John Wiegley <address@hidden> writes:
>
>> Right now, functions are interactive if declared with `interactive', and not
>> otherwise. The suggestion at hand is to allow `interactive' forms to become
>> conditional -- possibly in multiple ways. I like this concept, and think the
>> right place for it is indeed in core.
>>
>> The question is how to declare such conditionality. We can do this rather
>> easily by accepting new keyword arguments to `interactive':
>>
>> (interactive "sDirectory: " [:mode foo-mode] [:when <function>])
>
> That does sound kinda exciting. To take a random example, `M-x
> delete-matching-lines' could have a :when of `buffer-writable-p' and not
> auto-complete when in a read-only buffer. Etc.
It seems interactive already has support for a limited version of this:
> If ‘*’ appears at the beginning of the string, then an error is signaled if
the buffer is read-only.
So the annotation is already there, at least for some function that use a
string-based interactive spec. But maybe everyone already had this in mind?
(450 of the approx 4500 string-based interactive specs in core Emacs use that)
Clément.
signature.asc
Description: OpenPGP digital signature
- Re: Making `interactive' conditional, (continued)
- Message not available
- Re: Making `interactive' conditional, Artur Malabarba, 2016/01/10
- Re: Making `interactive' conditional, Richard Stallman, 2016/01/10
- Re: Making `interactive' conditional, Lars Magne Ingebrigtsen, 2016/01/11
- Re: Making `interactive' conditional, Stefan Monnier, 2016/01/11
- Re: Making `interactive' conditional, Óscar Fuentes, 2016/01/11
- RE: Making `interactive' conditional, Herring, Davis, 2016/01/11
- Re: Making `interactive' conditional, Óscar Fuentes, 2016/01/11
- Re: Making `interactive' conditional, Lars Magne Ingebrigtsen, 2016/01/11
- Re: Making `interactive' conditional,
Clément Pit--Claudel <=
- Re: Making `interactive' conditional (was: Leaving out non-applicable commands on Mx), Alan Mackenzie, 2016/01/10
- Re: Making `interactive' conditional, Óscar Fuentes, 2016/01/10
- RE: Making `interactive' conditional, Drew Adams, 2016/01/10
- Re: Making `interactive' conditional, Óscar Fuentes, 2016/01/10
- RE: Making `interactive' conditional, Drew Adams, 2016/01/10
- Re: Making `interactive' conditional, Óscar Fuentes, 2016/01/10
- RE: Making `interactive' conditional (was: Leaving out non-applicable commands on Mx), Drew Adams, 2016/01/10
- Re: Making `interactive' conditional, Stefan Monnier, 2016/01/11
- RE: Making `interactive' conditional, Drew Adams, 2016/01/11
- Re: Making `interactive' conditional, Clément Pit--Claudel, 2016/01/10