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: Mon, 27 Feb 2017 11:21:34 -0800 (PST) Message-ID: <3e265625-6c16-424c-9fb2-6a7144dcc349@default> References: <1efbacdb-7d86-454d-b0e0-7a783c47b804@default> <87poi4e7mv.fsf@users.sourceforge.net> <877f4beok7.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 1488223884 24164 195.159.176.226 (27 Feb 2017 19:31:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 27 Feb 2017 19:31:24 +0000 (UTC) Cc: 25777@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 27 20:31:20 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 1ciR0u-0005VL-QZ for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Feb 2017 20:31:16 +0100 Original-Received: from localhost ([::1]:56269 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciR10-00069o-V4 for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Feb 2017 14:31:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciQs1-0007N4-Gg for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2017 14:22:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciQry-0004aA-CX for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2017 14:22:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60469) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ciQry-0004a4-9d for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2017 14:22:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ciQry-0006Bc-1v for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2017 14:22:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Feb 2017 19:22: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: patch Original-Received: via spool by 25777-submit@debbugs.gnu.org id=B25777.148822330423757 (code B ref 25777); Mon, 27 Feb 2017 19:22:01 +0000 Original-Received: (at 25777) by debbugs.gnu.org; 27 Feb 2017 19:21:44 +0000 Original-Received: from localhost ([127.0.0.1]:58668 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciQrg-0006B7-JL for submit@debbugs.gnu.org; Mon, 27 Feb 2017 14:21:44 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:50807) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciQre-0006At-Rb for 25777@debbugs.gnu.org; Mon, 27 Feb 2017 14:21:43 -0500 Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v1RJLaiN020741 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Feb 2017 19:21:36 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v1RJLaUU009468 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Feb 2017 19:21:36 GMT Original-Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v1RJLZcB013609; Mon, 27 Feb 2017 19:21:36 GMT In-Reply-To: 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: aserv0022.oracle.com [141.146.126.234] 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:129899 Archived-At: > > Just as, for Emacs 24.5, I reused some code from rect.el to > > do what I need to get the rectangle columns, so I reused > > the corresponding code from Emacs 25. > > > > Look at function `apply-on-rectangle'. In Emacs 25 it calls > > `rectangle--pos-cols' to get the rectangle columns - and so > > do I. In Emacs 24.5 it also does just what I do (I stole > > the code) to obtain those columns. >=20 > In both 24.5 and 25.1, apply-on-rectangle wraps its body in > save-excursion, and in both versions the body contains no nested > save-excursions. So it looks to me like the regression is in your code > which decides not to call save-excursion when running on Emacs 25. OK, clearly I'm not getting through to you. The bug will remain, and I'll wrap my calls to `rectangle--pos-cols' in `save-excursion'. For the record: 1. I do not call `apply-on-rectangle'. 2. The purpose of `rectangle--pos-cols', just as was the purpose of the previous (Emacs 24.5) code, is to return the rectangle columns. Nothing more. Its purpose is not to move point and leave it in some other place that is not a rectangle corner. 3. `rectangle--pos-cols' is a general function. It should not be considered internal. It is useful generally - I have reused it, as one example. (I have not used `apply-on-rectangle'.) Is there a reason to have `rectangle--pos-cols' move point, instead of use `save-excursion'? You've given none. Do you argue that performance matters here? What's the argument in favor of not having this code be as clean as it was in Emacs 24.5? Why favor this regression?