From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: Making `interactive' conditional Date: Sun, 10 Jan 2016 05:09:32 -0500 Message-ID: <56922DDC.1080702@gmail.com> References: <87mvszdp6b.fsf@gnus.org> <8737u9kv6f.fsf@russet.org.uk> <87fuy7hdc6.fsf_-_@wanadoo.es> <87bn8vh8q4.fsf@wanadoo.es> <4002fc97-5629-4367-8b8f-48b659fefdce@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="d759vWN013ueiAdjadoRmnkrkkhAeFi7x" X-Trace: ger.gmane.org 1452420595 11304 80.91.229.3 (10 Jan 2016 10:09:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Jan 2016 10:09:55 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 10 11:09:44 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aICwR-0006cF-Ve for ged-emacs-devel@m.gmane.org; Sun, 10 Jan 2016 11:09:44 +0100 Original-Received: from localhost ([::1]:46205 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aICwQ-0004Nb-Vt for ged-emacs-devel@m.gmane.org; Sun, 10 Jan 2016 05:09:42 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aICwM-0004NW-Nb for emacs-devel@gnu.org; Sun, 10 Jan 2016 05:09:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aICwJ-0006AD-GF for emacs-devel@gnu.org; Sun, 10 Jan 2016 05:09:38 -0500 Original-Received: from mout.kundenserver.de ([212.227.126.130]:63752) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aICwJ-0006A4-6T for emacs-devel@gnu.org; Sun, 10 Jan 2016 05:09:35 -0500 Original-Received: from [18.189.87.242] ([18.189.87.242]) by mrelayeu.kundenserver.de (mreue003) with ESMTPSA (Nemesis) id 0M3wNK-1a0Ga40KUk-00rUMC for ; Sun, 10 Jan 2016 11:09:34 +0100 X-Enigmail-Draft-Status: N1110 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 In-Reply-To: X-Provags-ID: V03:K0:l7rRTkZUMT9dOLaAhEXkOv3PinIslMHa3T2nZHfvk93rVekElIw AqpyRLweJvMSOCqHwcaqGnhgIFtkmeV9VLx8QzA6XeNC5/Y8zZXgfdrKwFTTD9b9VQe6Hb9 z5D8aoDCPH+TkOC4LWZdLigdQqecrQiBa6jGMy6VQh9DS39UOKzWVltb+9UqROmOvyAeEpc DP/R7T8MfZHG8pCLCxkPg== X-UI-Out-Filterresults: notjunk:1;V01:K0:6s+0KETBTUg=:Umj5quVtNZvVLCZWSVigWq BX5EN6mIXoYoF7cfqkVMk7SUb9Tcnbt3kJGBIXHzSw1zkh6tUlGQ4lfpBgwtZRiHMhJUM1BSZ PMRv3+biDe/hxLSFkrfaKuAHOTjGaO51TlM906HZEgfPxoZs1vubFeNEISkcHvY4KK97jdOcj AvFIhD1HWhjLN1IHnsvBsu6xDydp4/Ew23+Slsvd61cE9PkvEJCL1+5sAEeYK4tzKIPhZW6JE KaHsUmgBWYFg7rScmz1Yo6IwmTARl7kIUy1tfeopWct1n57KPao7tGZNjFDnCFa8eUaY8ymiM JXfcwHRZwM2FM//Y2/dNbJTJOFPOC9t8gvDLmoxXTEJ9rTo11Djex1xrgl8F2FmHSbOYklbi+ ibfaYyLs34lwmDtGS+TTalKQ68eDjfaDBPPMJHmAFgSSghfGPlBxoIloThIQctqfsXF2UJj+H gcuOjuevBq/asIJ4EI2LMN7C3IHiZv5CFWmi1JUut/pkT5s08BS4BHsiLCnEiPoHHcDOfU8df 3XrHuVAkzDhOFeg/B4rm9CgDaL2OWO81Az/qgsWNxiXw7xo61xeQ+GDndx1A+cWEiWxcyyb3t GcJYbdSpAcZDeGdj5IAwYigC0XSee52hdLDYPzfhp4sxij+8MGXDqGSMUVXaSpk6o7wwg4j3C iSeHe1vGoRNg+XzXRVftO3ycblMKrx8cQNCyZhDoHNpaafyRQAPdsn/RGrcRIs3G34a0= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.130 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:197961 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --d759vWN013ueiAdjadoRmnkrkkhAeFi7x Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 01/10/2016 04:02 AM, Lars Magne Ingebrigtsen wrote: > John Wiegley writes: >=20 >> Right now, functions are interactive if declared with `interactive', a= nd not >> otherwise. The suggestion at hand is to allow `interactive' forms to b= ecome >> conditional -- possibly in multiple ways. I like this concept, and thi= nk the >> right place for it is indeed in core. >> >> The question is how to declare such conditionality. We can do this rat= her >> easily by accepting new keyword arguments to `interactive': >> >> (interactive "sDirectory: " [:mode foo-mode] [:when ]) >=20 > That does sound kinda exciting. To take a random example, `M-x > delete-matching-lines' could have a :when of `buffer-writable-p' and no= t > auto-complete when in a read-only buffer. Etc. I think this is converging to what Stefan pointed earlier (which I found = very convincing/exciting): in its most basic form, this proposal could su= persede a lot of ad-hoc checking that many many commands do (by calling `= barf-if-buffer-read-only', for example). Similarly, there are many commands that are marked interactive because th= ey are bound to keys in certain contexts, but make no sense (and will jus= t immediately error out if called from M-x) otherwise. I find it reasonab= le to think that if a command is just going to exit in error as soon as I= call it I probably don't want it to feature prominently among M-x comple= tions. Cheers, CL=E9ment. --d759vWN013ueiAdjadoRmnkrkkhAeFi7x Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJWki3cAAoJEPqg+cTm90wj4nkP/3eZJe3eI/LPXZOBWfBqxGFf I4VXWGASVw4KTa7+Jo7n+EIJvP84SCysEjXgEUc3G6VDvJlqiiJ7BS2uHDpEiJyU cNq49VT5kn1a3Ezf9ss3+ppptQ/G+MFsn2RUiWzUOkJqhrZ8/uJPbELfV92lJfvz 2jWfmGCPPOXY+KdkCp56Mv5v1puC/8zWFwR3QBuOuIKfMvpRetJi22v+gKci2vuQ 7+soBD7qAya2cP0HgPr3ZHmE65gPmPKm/Hx2CGUEpARxJtJrvOiaXcozbrOvtwiP U695rqa7eK5t/NM2EA/2YA1H1VUkzSek3vwr+EqXxBeVK3ZJvIlVsR5/EnRlvXqr ewv6/bXlNyMWfu6KXhk3Sb4tDPRPVzvsYe5jz0MeICNVABGuX+WIMpe1TPBGIBFc 152Zxwqr8xXrdroGWS3c4c8PHXOXNxDXjfTRPu9d4pnIhGfCvNHnsko/jXDQiErO 94fSE7zQj7PmmlrtjqHderJQv06BRf2DDaZ2XfBz8HCjRYJetcmUiDEs5+TjD8zw 7TxbhJtNEC/nHKGhrfjc9VU+WXq9YH5uTFUEOUkqb/WtnWF0NhUI3Lt5XVWhHner x+Pjcp0Llo3ACxZEEi9QV4ZyMu+E4T0oF3jY9SpGYGCk+BW1DyljSoSJGbDzIV7M ekNZvTEGdC+WtG2WNy4H =5Svx -----END PGP SIGNATURE----- --d759vWN013ueiAdjadoRmnkrkkhAeFi7x--