From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#19829: 25.0.50; Design of commands operating on rectangular regions Date: Tue, 30 Jun 2015 22:29:32 -0400 Message-ID: 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 X-Trace: ger.gmane.org 1435717831 8706 80.91.229.3 (1 Jul 2015 02:30:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 1 Jul 2015 02:30:31 +0000 (UTC) Cc: Bastien , 19829@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 01 04:30:20 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 1ZA7n1-0003M7-To for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 Jul 2015 04:30:20 +0200 Original-Received: from localhost ([::1]:49411 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZA7n1-0000kX-3S for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Jun 2015 22:30:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40672) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZA7mx-0000jv-NP for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2015 22:30:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZA7mr-0004LL-OQ for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2015 22:30:15 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZA7mr-0004KT-LF for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2015 22:30:09 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZA7mq-0004wc-8r for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2015 22:30:08 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Jul 2015 02:30:06 +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.143571778218951 (code B ref 19829); Wed, 01 Jul 2015 02:30:06 +0000 Original-Received: (at 19829) by debbugs.gnu.org; 1 Jul 2015 02:29:42 +0000 Original-Received: from localhost ([127.0.0.1]:34993 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZA7mP-0004vb-Eq for submit@debbugs.gnu.org; Tue, 30 Jun 2015 22:29:41 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:20653) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZA7mM-0004vN-QB for 19829@debbugs.gnu.org; Tue, 30 Jun 2015 22:29:39 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AvEwA731xV/2cGNJ1cgxCEAoVVuzcJhH6CTQQCAoE8ORQBAQEBAQEBgQpBBYNdAQEDAVYjBQsLNBIUGA0kiDcIzyMBAQEBAQEEAQEBAR6LOoUFB4QtBYtEqUAjhBQigngBAQE X-IPAS-Result: A0AvEwA731xV/2cGNJ1cgxCEAoVVuzcJhH6CTQQCAoE8ORQBAQEBAQEBgQpBBYNdAQEDAVYjBQsLNBIUGA0kiDcIzyMBAQEBAQEEAQEBAR6LOoUFB4QtBYtEqUAjhBQigngBAQE X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="128924597" Original-Received: from 157-52-6-103.cpe.teksavvy.com (HELO pastel.home) ([157.52.6.103]) by ironport2-out.teksavvy.com with ESMTP; 30 Jun 2015 22:29:33 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id E436E5FE1B; Tue, 30 Jun 2015 22:29:32 -0400 (EDT) In-Reply-To: <87d20dszao.fsf_-_@mail.linkov.net> (Juri Linkov's message of "Tue, 30 Jun 2015 23:42:55 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) 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:104556 Archived-At: > Here is a composite patch with implementation of rectangular regions > based on three different use cases: Looks pretty good, thanks. > +(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 ,@)? > -(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 argument. Stefan