From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Interactive hat. Date: Wed, 25 Mar 2009 10:53:16 +0000 Message-ID: <20090325105316.GB1487@muc.de> References: <20090323223703.GA5650@muc.de> <20090324135210.GA4657@muc.de> <20090325101650.GA1487@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1237978462 4631 80.91.229.12 (25 Mar 2009 10:54:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Mar 2009 10:54:22 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: Miles Bader Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 25 11:55:39 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LmQlj-0005vL-ED for ged-emacs-devel@m.gmane.org; Wed, 25 Mar 2009 11:55:36 +0100 Original-Received: from localhost ([127.0.0.1]:56667 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LmQkM-0007NN-C3 for ged-emacs-devel@m.gmane.org; Wed, 25 Mar 2009 06:54:10 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LmQkH-0007Mq-0Z for emacs-devel@gnu.org; Wed, 25 Mar 2009 06:54:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LmQkC-0007Kn-EH for emacs-devel@gnu.org; Wed, 25 Mar 2009 06:54:04 -0400 Original-Received: from [199.232.76.173] (port=40756 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LmQkC-0007Kk-BG for emacs-devel@gnu.org; Wed, 25 Mar 2009 06:54:00 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:2108 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LmQkB-00037T-Pt for emacs-devel@gnu.org; Wed, 25 Mar 2009 06:54:00 -0400 Original-Received: (qmail 50751 invoked by uid 3782); 25 Mar 2009 10:53:57 -0000 Original-Received: from acm.muc.de (pD9E50975.dip.t-dialin.net [217.229.9.117]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Wed, 25 Mar 2009 11:53:55 +0100 Original-Received: (qmail 2202 invoked by uid 1000); 25 Mar 2009 10:53:16 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:109817 Archived-At: Hi, Miles! On Wed, Mar 25, 2009 at 07:30:13PM +0900, Miles Bader wrote: > Alan Mackenzie writes: > > How is an external library writer going to use the interactive "^"? > > Assuming that the library should also work under XEmacs and Emacs 22, > > just using the "^" won't work; an interactive string with "^" throws an > > error in Emacs 22. > Isn't that a pretty basic problem with _any_ extension to interactive? > Do you think `interactive' should never be extended? Yes, and yes. Or, rather, yes and yes except in the most exceptional of circumstances, such as adding a new parameter type. > In this case, I think the right solution would be to simply add another, > possibly clunkier method for commands to indicate they want to enable > shift-selection behavior. Agreed. > E.g.: have the command loop also look for a `handle-shift-select' > property on command-name's plist, and treat that as it would "^" in the > interactive string. Then external library authors who are worried about > backwards compability could use (put COMMAND 'handle-shift-select t) > instead of putting ^ in COMMAND's interactive string. Agreed, except I wouldn't put it in the command loop - I'd put it in a hook (pre-command-hook), for the same reason font-locking is in a hook rather than directly in the command loop. M-x shift-select would install/remove this function onto/from the hook. Now the question arises, if we've got the property `handle-shift-select', doesn't the "^" in the interactive string become redundant? > [Yeah, that only works for commands which are defined functions, but I > think that's an acceptable limitation for a feature like this which > should be used only rarely.] Yes, a lambda expression can't use this. That's the only use of "^" I can see which absolutely requires "^". But let's be honest, how often do hackers write movement commands as anonymous lambdas? > -Miles > -- > "1971 pickup truck; will trade for gnus" Hey, you can get gnus for nothing. :-) -- Alan Mackenzie (Nuremberg, Germany).