From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#19829: 25.0.50; Design of commands operating on rectangular regions Date: Thu, 02 Jul 2015 01:17:53 +0300 Organization: LINKOV.NET Message-ID: <87mvzfa5f2.fsf@mail.linkov.net> References: <87r3txhkz1.fsf@ceis-strat.com> <87twyt5o8q.fsf@mail.linkov.net> <874mqsq6ar.fsf@mail.linkov.net> <87zj8iljfk.fsf@mail.linkov.net> <87r3tnax8h.fsf@mail.linkov.net> <877fvdu34b.fsf@mail.linkov.net> <87mw44phaf.fsf@mail.linkov.net> <87d20dszao.fsf_-_@mail.linkov.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1435790367 18892 80.91.229.3 (1 Jul 2015 22:39:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 1 Jul 2015 22:39:27 +0000 (UTC) Cc: Bastien , 19829@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 02 00:39:17 2015 Return-path: Envelope-to: geb-bug-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 1ZAQey-0002b5-GT for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 Jul 2015 00:39:16 +0200 Original-Received: from localhost ([::1]:33120 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAQex-0006sb-Et for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 Jul 2015 18:39:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAQeo-0006kA-6T for bug-gnu-emacs@gnu.org; Wed, 01 Jul 2015 18:39:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAQek-0000HG-NW for bug-gnu-emacs@gnu.org; Wed, 01 Jul 2015 18:39:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35079) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAQek-0000HA-JP for bug-gnu-emacs@gnu.org; Wed, 01 Jul 2015 18:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZAQek-0002iL-Cc for bug-gnu-emacs@gnu.org; Wed, 01 Jul 2015 18:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Jul 2015 22:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19829 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19829-submit@debbugs.gnu.org id=B19829.143579028410312 (code B ref 19829); Wed, 01 Jul 2015 22:39:02 +0000 Original-Received: (at 19829) by debbugs.gnu.org; 1 Jul 2015 22:38:04 +0000 Original-Received: from localhost ([127.0.0.1]:36523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZAQdn-0002gG-FN for submit@debbugs.gnu.org; Wed, 01 Jul 2015 18:38:03 -0400 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:48673 helo=homiemail-a13.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZAQdk-0002ff-LW for 19829@debbugs.gnu.org; Wed, 01 Jul 2015 18:38:01 -0400 Original-Received: from homiemail-a13.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a13.g.dreamhost.com (Postfix) with ESMTP id 3955C334075; Wed, 1 Jul 2015 15:37:57 -0700 (PDT) Original-Received: from localhost.linkov.net (m212-53-110-158.cust.tele2.ee [212.53.110.158]) (Authenticated sender: jurta@jurta.org) by homiemail-a13.g.dreamhost.com (Postfix) with ESMTPA id 17CE8334072; Wed, 1 Jul 2015 15:37:55 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Tue, 30 Jun 2015 22:29:32 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:104592 Archived-At: >> +(defun region () >> + `(region >> + (positions ,@(funcall region-extract-function 'positions)))) > > I don't think we want such a short name. How 'bout `region-boundaries'= ? > Also, why `(region (positions ,@)) rather than something simpler > like `(region ,@)? The goal is to design the interface as general as possible to be able to define potential future non-rectangular regions. For instance, a circular region could be defined in the future as: (region (shape . circle) (radius . 42) (center . ...) ... Then to distinguish a rectangular region we could add (shape . rectangle) to the current information: (region (shape . rectangle) (positions . ...) ... >> -(defun query-replace (from-string to-string &optional delimited start= end backward) >> +(defun query-replace (from-string to-string &optional delimited start= end backward region) > [...] >> + (if (use-region-p) (region-beginning)) >> + (if (use-region-p) (region-end)) >> + (nth 3 common) >> + (if (use-region-p) (region))))) > > I think we should re-use one of START or END rather than add a REGION a= rgument. Stuffing the region information into one of its boundary args would be to= o ugly. I guess this is why you designed a cleaner interface by adding a REGION a= rgument to several commands: (defun kill-region (beg end &optional region) (defun kill-ring-save (beg end &optional region) (defun copy-region-as-kill (beg end &optional region) with such a clean docstring: "The optional argument REGION if non-nil, indicates that we're not just= killing some text between BEG and END, but we're killing the region. that will fit other commands like =E2=80=98downcase-region=E2=80=99 and =E2= =80=98shell-command-on-region=E2=80=99 when replacing =E2=80=9Ckilling the region=E2=80=9D with a more general =E2= =80=9Coperating on the region=E2=80=9D.