From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Shift selection using interactive spec Date: Sun, 30 Mar 2008 04:05:31 +0300 Organization: JURTA Message-ID: <871w5t3svo.fsf@jurta.org> References: <87k5k69p92.fsf@stupidchicken.com> <878x0if9ul.fsf@stupidchicken.com> <87od9e9gnx.fsf@stupidchicken.com> <87skyo5bvk.fsf@stupidchicken.com> <87skynrin5.fsf@stupidchicken.com> <87iqzju0lq.fsf@kfs-lx.rd.rdm> <851w5xx5ya.fsf@lola.goethe.zz> <87ve3993dt.fsf@jurta.org> <47EA37C7.7080502@gmail.com> <878x050yp0.fsf@jurta.org> <878x03ybyg.fsf@jurta.org> <871w5upcsc.fsf@jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1206840496 3631 80.91.229.12 (30 Mar 2008 01:28:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Mar 2008 01:28:16 +0000 (UTC) Cc: jared@hpalace.com, lennart.borgman@gmail.com, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 30 03:28:46 2008 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 1JfmLm-0006sH-Cr for ged-emacs-devel@m.gmane.org; Sun, 30 Mar 2008 03:28:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JfmLA-000420-IP for ged-emacs-devel@m.gmane.org; Sat, 29 Mar 2008 21:28:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JfmL5-00041l-Qg for emacs-devel@gnu.org; Sat, 29 Mar 2008 21:28:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JfmL3-00041Y-Ey for emacs-devel@gnu.org; Sat, 29 Mar 2008 21:28:02 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JfmL3-00041V-9c for emacs-devel@gnu.org; Sat, 29 Mar 2008 21:28:01 -0400 Original-Received: from relay01.kiev.sovam.com ([62.64.120.200]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JfmKz-0006Eq-DV; Sat, 29 Mar 2008 21:27:57 -0400 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay01.kiev.sovam.com with esmtp (Exim 4.67) (envelope-from ) id 1JfmKs-0004Rc-UJ; Sun, 30 Mar 2008 04:27:55 +0300 In-Reply-To: (Richard Stallman's message of "Sat, 29 Mar 2008 12:37:47 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu) X-Scanner-Signature: b22dd54e5e410b0526d530b08df0ebb5 X-DrWeb-checked: yes X-SpamTest-Envelope-From: juri@jurta.org X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 2516 [Mar 28 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {HEADERS: header Content-Type found without required header Content-Transfer-Encoding} X-SpamTest-Method: none X-SpamTest-Rate: 10 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0255], KAS30/Release X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.8-5.1 (or MacOS X 10.2-10.3) 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:93860 Archived-At: > As I understand the purpose of this feature is practically to move > the last expression of the command's body that usually is written as > > (if (interactive-p) > (message "Result of this command is %.0f" return-value) > (format "%.0f" return-value)) > > You have the right idea in mind for what the code would be trying to > do. But code like that would be a strange way to write it, and in > practice does seem to occur much if at all. The way I would envision > this is more like > > (if interactive-call > (message "Result of this command is %.0f" return-value)) > return-value) > > where `interactive-call' is an argument initialized to non-nil > for an interactive call. > > The job of the second arg to `interactive', that I've proposed, would > be to control how to generate the message in the interactive case. Then the second arg to `interactive' could be just a lambda with one argument with the value this function returns, e.g. (defun command () (interactive nil (lambda (ret-val) (message "Result of this command is %.0f" ret-val))) ... (let ((return-value ...)) ... return-value)) -- Juri Linkov http://www.jurta.org/emacs/