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, 07 Jul 2015 08:20:28 -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> <87mvzfa5f2.fsf@mail.linkov.net> <877fqi89ii.fsf@mail.linkov.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1436271686 17008 80.91.229.3 (7 Jul 2015 12:21:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 7 Jul 2015 12:21:26 +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 Tue Jul 07 14:21:11 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 1ZCRs6-0003vF-AK for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Jul 2015 14:21:10 +0200 Original-Received: from localhost ([::1]:57089 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCRs5-0007Uk-MY for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Jul 2015 08:21:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60256) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCRs2-0007UQ-0u for bug-gnu-emacs@gnu.org; Tue, 07 Jul 2015 08:21:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCRry-00064c-Iv for bug-gnu-emacs@gnu.org; Tue, 07 Jul 2015 08:21:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41640) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCRry-000642-7Y for bug-gnu-emacs@gnu.org; Tue, 07 Jul 2015 08:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZCRrx-0006iH-Rv for bug-gnu-emacs@gnu.org; Tue, 07 Jul 2015 08:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Jul 2015 12:21:01 +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.143627163525766 (code B ref 19829); Tue, 07 Jul 2015 12:21:01 +0000 Original-Received: (at 19829) by debbugs.gnu.org; 7 Jul 2015 12:20:35 +0000 Original-Received: from localhost ([127.0.0.1]:43086 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZCRrW-0006hV-AL for submit@debbugs.gnu.org; Tue, 07 Jul 2015 08:20:34 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:36175) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZCRrU-0006hN-6F for 19829@debbugs.gnu.org; Tue, 07 Jul 2015 08:20:32 -0400 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t67CKSPU020271; Tue, 7 Jul 2015 08:20:28 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 59861AE043; Tue, 7 Jul 2015 08:20:28 -0400 (EDT) In-Reply-To: <877fqi89ii.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 03 Jul 2015 01:40:37 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5360=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5360> : inlines <3332> : streams <1467732> : uri <1978577> 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:104798 Archived-At: >> IOW, either your REGION arg uses a standard format (e.g. a list of >> (START . END) boundaries), or it should be just a constant saying "use >> things like region-extract-function ". > Or better to check the value returned by region-extract-function > in `interactive' with: > (defun region-nonstandard () > (> (length (funcall region-extract-function 'positions)) 1)) > like the patch below does. The idea of a constant saying "use the region" is also to distinguish it from the case where the function is called non-interactively with boundaries which aren't necessarily related to the current region. > region-noncontiguous I like this name (tho with a final "-p") since it says precisely what it means. > Then we could replace in `interactive' calls `region-beginning' > with `region-beginning-nonstandard' defined as: No, I'd just replace it with the special constant that says "use things like region-extract-function". This constant could be just t or `region'. > But I'm still not sure whether ugly is nicer than hideous, > so this patch doesn't use it yet. I think the first thing is to figure out what is the ideal API, ignoring backward compatibility. In this ideal case, I think we'd just want a single arg which takes a "region descriptor" (along the lines of what you described earlier, tho its format would be opaque) with methods like `region-contiguous-p', `region-beginning', `region-end', `region-chunks', `region-extract', ... Then we can try and figure how to adapt it to the real world and how to get from here to there. But I think it mostly means we'll want to go from two args (START/END) to just a single arg. So adding an argument doesn't seem to be the obvious best choice. Stefan