From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#25777: 25.1; [PATCH] `rectangle--pos-cols' should not move point Date: Tue, 28 Feb 2017 07:11:08 -0800 (PST) Message-ID: <512a3db8-49d0-4802-aecc-2d71049e0b25@default> References: <1efbacdb-7d86-454d-b0e0-7a783c47b804@default> <87poi4e7mv.fsf@users.sourceforge.net> <877f4beok7.fsf@users.sourceforge.net> <87tw7edi9d.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1488296052 32002 195.159.176.226 (28 Feb 2017 15:34:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 28 Feb 2017 15:34:12 +0000 (UTC) Cc: 25777@debbugs.gnu.org To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 28 16:34:08 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cijmt-0007Mn-R3 for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Feb 2017 16:34:04 +0100 Original-Received: from localhost ([::1]:33952 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cijmy-0001rq-5l for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Feb 2017 10:34:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cijRe-0007g3-7b for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2017 10:12:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cijRa-0003kV-4O for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2017 10:12:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33965) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cijRa-0003kP-0Y for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2017 10:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cijRZ-0001Ai-MO for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2017 10:12:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Feb 2017 15:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25777 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25777-submit@debbugs.gnu.org id=B25777.14882946794442 (code B ref 25777); Tue, 28 Feb 2017 15:12:01 +0000 Original-Received: (at 25777) by debbugs.gnu.org; 28 Feb 2017 15:11:19 +0000 Original-Received: from localhost ([127.0.0.1]:60397 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cijQt-00019a-CM for submit@debbugs.gnu.org; Tue, 28 Feb 2017 10:11:19 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:47946) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cijQs-00019O-4h for 25777@debbugs.gnu.org; Tue, 28 Feb 2017 10:11:18 -0500 Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v1SFBA7i029714 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 28 Feb 2017 15:11:11 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.13.8/8.14.4) with ESMTP id v1SFBAaI002594 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 28 Feb 2017 15:11:10 GMT Original-Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v1SFB98X018568; Tue, 28 Feb 2017 15:11:09 GMT In-Reply-To: <87tw7edi9d.fsf@users.sourceforge.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:129944 Archived-At: > > I think it's great that a function such as `rectangle--pos-cols' > > was added. (But it has no business being considered "internal".) > > > > Do you really think that a function whose only purpose is > > to let you know what the rectangle columns are should move > > point and leave it in a position that is not one of the > > rectangle corners? >=20 > After looking over this thread again, I conclude we got totally > side-tracked on the question of whether this is a regression or not. > That's just a distraction. I agree, and that was my fault. In my mind it caused my code to regress. My bad. > I think it's reasonable to make rectangle--pos-cols preserve point. > Could you update your patch to >=20 > 1. Use a single save-excursion around the whole body, instead of adding > several. > 2. Rename rectangle--pos-cols to rectangle-pos-cols. > 3. Add a docstring to rectangle-pos-cols. I could do that, yes. But IMHO, it is generally better to scope a `save-excursion' as tightly as possible around the movement that you want to control (hide, erase, undo). Unless there is something critical for performance (and I don't think `save-excursion' is costly), that's better. Why? Because it makes the code much clearer. It tells you that outside the `save-excursion' zones point is unlikely to be moved. And that makes maintenance easier and less error-prone. Putting a `s-e' at a wider location is analogous to putting a mutex block at an unnecessarily wide location. (Yes, there is no real connection between those two, but it comes down to doing something only where/when it's needed.) If you confirm that you really want that wider scope here for `s-e' then I'll do that. Otherwise, I'll keep the `s-e' occurrences where they are but do the renaming and add a doc string. Let me know. Thx.