From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#25777: 25.1; [PATCH] `rectangle--pos-cols' should not move point Date: Mon, 27 Feb 2017 13:50:02 -0500 Message-ID: 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 X-Trace: blaine.gmane.org 1488221639 10585 195.159.176.226 (27 Feb 2017 18:53:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 27 Feb 2017 18:53:59 +0000 (UTC) Cc: 25777@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 27 19:53:55 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 1ciQQk-0002Jy-BJ for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Feb 2017 19:53:54 +0100 Original-Received: from localhost ([::1]:55773 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciQQq-0001sN-E1 for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Feb 2017 13:54:00 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34446) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciQO2-0008Im-KR for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2017 13:51:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciQNy-0008FU-4s for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2017 13:51:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60455) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ciQNy-0008F9-1T for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2017 13:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ciQNx-0005TN-QT for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2017 13:51:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Feb 2017 18:51: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.148822141020979 (code B ref 25777); Mon, 27 Feb 2017 18:51:01 +0000 Original-Received: (at 25777) by debbugs.gnu.org; 27 Feb 2017 18:50:10 +0000 Original-Received: from localhost ([127.0.0.1]:58654 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciQN8-0005SJ-GI for submit@debbugs.gnu.org; Mon, 27 Feb 2017 13:50:10 -0500 Original-Received: from mail-ot0-f170.google.com ([74.125.82.170]:33336) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciQN7-0005S6-0Y for 25777@debbugs.gnu.org; Mon, 27 Feb 2017 13:50:09 -0500 Original-Received: by mail-ot0-f170.google.com with SMTP id k4so57918203otc.0 for <25777@debbugs.gnu.org>; Mon, 27 Feb 2017 10:50:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=j9iZ10KmrO6lY50pEJ4aEfPoUI/mONMwpIe6tOnfoQQ=; b=tyyutNd/GTFtltkACM4tbB4QFo8yV33VioXw+V3pkDigjIO+2SzF/Qtzz25EU1P3zy hbrdPwSXiVjQ8f5JaLvZmIrqUG9tSgDVDxNHb8IbEu71M0CamXJUKM7XRJbxthccgmBJ y9sA6mvCjiXc8XQVUWfQp/PWjP4t0WcqMSljHXWOBGCoKQBX6b53hIBbNAFyOQ4F5Yqm TFcSYU5qSMudsSTPsXvZYgwr6ccKnLh7B3NCSv0Mu8naVySU1TAVOX1gMHDLfn3xHUXR WC2JsUaM1n5N7E4HVbJ+IdAAhw1GoB6wLWUbywtFXmethVYzBthqJa4UM+ZJkGnbOsw0 rJJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=j9iZ10KmrO6lY50pEJ4aEfPoUI/mONMwpIe6tOnfoQQ=; b=KU6oFgw+tmHgiyF71U77YksPasp5VuzDpInEWQcM81s2Xqrf4MMJEzv4sRzKhDorm+ WTRRB25SbJojW88dwrZiqgHc2oiqcPwGbUbPIltmlb8MZ3hEzpFtVZJA9+/jPjHQ94lh m0DZD5fqdAsqWRB71tPWMOHO9TFBC/7YvQQXOxEDY9b/vkIqH8zFEABW5G15WhUUb+ck 15cFyqhKPcO6ZMi4VZ9O070QgV1xtOGpJBTKHtsQVloIMQxot04LHTGHUNm2j91SQDcX hOhq04NkC5VVwzCTqCZl5Qd5GDg8WerswohDojXaZbLSWfnCd6s+/8t9m05GlX+Yuivv 0ldA== X-Gm-Message-State: AMke39lAi7YXtKySLVp6fx1r7vZ1FjNHQKkKe8S8mMJc+A61pgPElHrrYW3yy8LDUS8KGEc814RMROoDy9AwuA== X-Received: by 10.157.62.203 with SMTP id b69mr8605101otc.30.1488221403209; Mon, 27 Feb 2017 10:50:03 -0800 (PST) Original-Received: by 10.157.35.87 with HTTP; Mon, 27 Feb 2017 10:50:02 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: -aYywXv8PBbcfzC1SfrCbruio6U 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:129894 Archived-At: On Mon, Feb 27, 2017 at 12:51 PM, Drew Adams wrote: > 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. 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. (if modelinepos-rect-p (if (fboundp 'rectangle--pos-cols) ; Emacs 25+ (let ((rpc (rectangle--pos-cols (region-beginning) (region-end)))) (abs (- (car rpc) (cdr rpc)))) (let ((start (region-beginning)) (end (region-end)) startcol endcol) (save-excursion ...