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. [Was: CUA-like stuff spuriously enables transient-mark-mode] Date: Thu, 26 Mar 2009 12:44:53 +0000 Message-ID: <20090326124453.GC3358@muc.de> References: <20090323223703.GA5650@muc.de> <20090324135210.GA4657@muc.de> <20090325101650.GA1487@muc.de> <20090325141935.GC1487@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1238071556 26332 80.91.229.12 (26 Mar 2009 12:45:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Mar 2009 12:45:56 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 26 13:47:14 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 1LmozI-0001qX-OG for ged-emacs-devel@m.gmane.org; Thu, 26 Mar 2009 13:47:12 +0100 Original-Received: from localhost ([127.0.0.1]:56098 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lmoxv-0002yX-94 for ged-emacs-devel@m.gmane.org; Thu, 26 Mar 2009 08:45:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lmoxo-0002x9-8B for emacs-devel@gnu.org; Thu, 26 Mar 2009 08:45:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lmoxj-0002rj-Cr for emacs-devel@gnu.org; Thu, 26 Mar 2009 08:45:39 -0400 Original-Received: from [199.232.76.173] (port=44812 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lmoxj-0002rS-3o for emacs-devel@gnu.org; Thu, 26 Mar 2009 08:45:35 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:1529 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 1Lmoxi-0005SX-He for emacs-devel@gnu.org; Thu, 26 Mar 2009 08:45:34 -0400 Original-Received: (qmail 88875 invoked by uid 3782); 26 Mar 2009 12:45:32 -0000 Original-Received: from acm.muc.de (pD9E507B2.dip.t-dialin.net [217.229.7.178]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Thu, 26 Mar 2009 13:45:29 +0100 Original-Received: (qmail 4659 invoked by uid 1000); 26 Mar 2009 12:44:53 -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:109851 Archived-At: Hi, Juanma, On Wed, Mar 25, 2009 at 05:41:01PM +0100, Juanma Barranquero wrote: > On Wed, Mar 25, 2009 at 15:19, Alan Mackenzie wrote: > > I don't think so.  `interactive-form' is a DEFUN (in data.c) which hoiks > > the interactive string out of three different places for three different > > sorts of defun. > I don't think I'm understanding you. I'm talking about the > `interactive-form' symbol property, not the `interactive-form' > function. I.e.: > > The `interactive' form must be located at top-level in the > function body, or in the function symbol's `interactive-form' > property (*note Symbol Plists::). It has its effect because the > command loop looks for it before calling the function (*note > Interactive Call::). Once the function is called, all its body > forms are executed; at this time, if the `interactive' form occurs > within the body, the form simply returns `nil' without even > evaluating its argument. Sorry, I wasn't aware of this property. It does indeed work, but ONLY in Emacs 23. [ .... ] > > There's currently no `put-interactive-form', but there's no reason > > why one couldn't be written. > What does that gain over (put SYMBOL 'interactive-form INTERACTIVE-SPEC) ? The source for such a function, `put-interactive-form' assuming we could write it in lisp, could be printed in the elisp manual (page "Using Interactive"), and the maintainer of Foo Mode encouraged to copy it into her package and use it to maintain compatibility with older Emacsen and XEmacs, thusly: (defun foo-forward-blag (arg) "Move forward to the end of the current blag, ...." (interactive "^P") .....) (if (not emacs-23) (put-interactive-form 'foo-forward-blag "P")) Alternatively, we could recommend package maintainers not to use "^" directly in interactive strings, instead only putting them in the `interactive-form' property. But this kind of makes the "^" look contrived and kludgey. If we're going to be keeping interactive-hat, I think we definitely need some sort of warning to package maintainers to be careful with it, and we should offer them a recipe for maintaining compatibility. > Juanma -- Alan Mackenzie (Nuremberg, Germany).