From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Interactive hat. Date: Thu, 26 Mar 2009 17:18:05 -0400 Message-ID: References: <20090324135210.GA4657@muc.de> <20090325101650.GA1487@muc.de> <20090325141935.GC1487@muc.de> <20090326124453.GC3358@muc.de> <20090326152738.GF3358@muc.de> <20090326190603.GH3358@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1238102385 22130 80.91.229.12 (26 Mar 2009 21:19:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Mar 2009 21:19:45 +0000 (UTC) Cc: Juanma Barranquero , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 26 22:21:02 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 1Lmx0M-0001xW-Di for ged-emacs-devel@m.gmane.org; Thu, 26 Mar 2009 22:20:50 +0100 Original-Received: from localhost ([127.0.0.1]:41500 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lmwyz-00022k-4E for ged-emacs-devel@m.gmane.org; Thu, 26 Mar 2009 17:19:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lmwxo-0001Mz-H0 for emacs-devel@gnu.org; Thu, 26 Mar 2009 17:18:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lmwxj-0001Jx-Dn for emacs-devel@gnu.org; Thu, 26 Mar 2009 17:18:11 -0400 Original-Received: from [199.232.76.173] (port=59563 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lmwxj-0001Jt-7V for emacs-devel@gnu.org; Thu, 26 Mar 2009 17:18:07 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:57299 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lmwxi-0004YI-Ui for emacs-devel@gnu.org; Thu, 26 Mar 2009 17:18:07 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEACOOy0lFxIfy/2dsb2JhbACBUNMfg3cGhHU X-IronPort-AV: E=Sophos;i="4.38,428,1233550800"; d="scan'208";a="35735456" Original-Received: from 69-196-135-242.dsl.teksavvy.com (HELO pastel.home) ([69.196.135.242]) by ironport2-out.teksavvy.com with ESMTP; 26 Mar 2009 17:18:05 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 51BD47F74; Thu, 26 Mar 2009 17:18:05 -0400 (EDT) In-Reply-To: <20090326190603.GH3358@muc.de> (Alan Mackenzie's message of "Thu, 26 Mar 2009 19:06:03 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:109866 Archived-At: > No, that's not simpler or clearer. It's just pushing the work onto the > package maintainer. And it's a LOT of work. For example, > (interactive "^P\nr") > becomes > (interactive > (progn (if (fboundp 'handle-shift-selection) > (handle-shift-selection)) > `(current-prefix-arg > ,(if (< (point) (mark)) > ,@((point) (mark)) > ,@((mark) (point)))))) Yes, that's because "r" hasn't yet received the treatment I just gave to "^". As explained in my message of a couple days ago, it should always be easy to turn an interactive string into the corresponding lisp form. > , or something equally repulsive, requiring infinitely more debugging > than the string it replaces. Actually, in all likelyhood, (interactive (progn (if (fboundp 'handle-shift-selection) (handle-shift-selection)) (list current-prefix-arg (point) (mark)))) will work just fine (in 99% of the cases, the subsequent code has to figure out anyway whether `start' is indeed before `end' in case the function is called from Lisp rather than interactively). So you're exaggerating a little bit. > My proposal is to suggest to the maintainer she copy the macro from > .../lisp/compatibility.el into her own sources, rename it > `foo-defunh'[*] and write: Feel free to recommend it. I find it hideous. Stefan