From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: How to write the "interactive" form for a command acting on a region Date: Wed, 14 Jan 2015 00:35:31 +0100 Message-ID: <871tmy5k58.fsf@wmi.amu.edu.pl> References: <8761ca5oc2.fsf@wmi.amu.edu.pl> <87sifei7sf.fsf@yahoo.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1421192157 8420 80.91.229.3 (13 Jan 2015 23:35:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 Jan 2015 23:35:57 +0000 (UTC) To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 14 00:35:52 2015 Return-path: Envelope-to: geh-help-gnu-emacs@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 1YBB04-0002Jt-1p for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Jan 2015 00:35:52 +0100 Original-Received: from localhost ([::1]:41856 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBB03-0004AC-Es for geh-help-gnu-emacs@m.gmane.org; Tue, 13 Jan 2015 18:35:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBAzq-0004A6-Eh for help-gnu-emacs@gnu.org; Tue, 13 Jan 2015 18:35:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YBAzn-0005SM-1Y for help-gnu-emacs@gnu.org; Tue, 13 Jan 2015 18:35:38 -0500 Original-Received: from msg.wmi.amu.edu.pl ([2001:808:114:2::50]:54218) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBAzm-0005S9-QP for help-gnu-emacs@gnu.org; Tue, 13 Jan 2015 18:35:34 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id 2CEDD47F01 for ; Wed, 14 Jan 2015 00:35:33 +0100 (CET) Original-Received: from msg.wmi.amu.edu.pl ([127.0.0.1]) by localhost (msg.wmi.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FBVaHAEjkGNe for ; Wed, 14 Jan 2015 00:35:33 +0100 (CET) Original-Received: from localhost (117-116.echostar.pl [213.156.117.116]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id E975242061 for ; Wed, 14 Jan 2015 00:35:32 +0100 (CET) In-reply-to: <87sifei7sf.fsf@yahoo.fr> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:808:114:2::50 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:102058 Archived-At: On 2015-01-14, at 00:24, Nicolas Richard wrote: > Hello, > > > Marcin Borkowski writes: >> (if (use-region-p) >> (list (region-beginning) (region-end) t) (list (point-min) >> (point-max) t))) > > You could do (if (use-region-p) > (list (region-beginning) (region-end) t) (list nil nil t)) > > (naive suggestion -- I have no experience !) Ah, this looks nice! Seems a bit artificial, but defers the binding of the default values to the one and only one place, and hence avoids duplication. Thanks, I like it! Best, -- Marcin Borkowski This email was proudly sent http://mbork.pl from my Emacs.