On 01/10/2016 04:02 AM, Lars Magne Ingebrigtsen wrote: > John Wiegley 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 ]) > > 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.