From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#25777: 25.1; [PATCH] `rectangle--pos-cols' should not move point Date: Fri, 03 Mar 2017 08:28:55 -0500 Message-ID: <87zih2a3qg.fsf@users.sourceforge.net> References: <1efbacdb-7d86-454d-b0e0-7a783c47b804@default> <87poi4e7mv.fsf@users.sourceforge.net> <877f4beok7.fsf@users.sourceforge.net> <87tw7edi9d.fsf@users.sourceforge.net> <512a3db8-49d0-4802-aecc-2d71049e0b25@default> <87zih4bhhz.fsf@users.sourceforge.net> <2560c8d7-532e-4882-b3d4-3845312d218f@default> <8737evaz7b.fsf@users.sourceforge.net> <9d559ea2-b66f-4b05-9b95-243651239e13@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1488547697 23594 195.159.176.226 (3 Mar 2017 13:28:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 3 Mar 2017 13:28:17 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: 25777@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 03 14:28:12 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 1cjnFg-0005J6-Qo for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 Mar 2017 14:28:09 +0100 Original-Received: from localhost ([::1]:58074 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjnFm-0003Il-Rs for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 Mar 2017 08:28:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjnFf-0003Hh-GM for bug-gnu-emacs@gnu.org; Fri, 03 Mar 2017 08:28:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjnFa-0005JG-JW for bug-gnu-emacs@gnu.org; Fri, 03 Mar 2017 08:28:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39327) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cjnFa-0005J8-FA for bug-gnu-emacs@gnu.org; Fri, 03 Mar 2017 08:28:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cjnFa-0005Em-1g for bug-gnu-emacs@gnu.org; Fri, 03 Mar 2017 08:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Mar 2017 13:28: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.148854766920114 (code B ref 25777); Fri, 03 Mar 2017 13:28:01 +0000 Original-Received: (at 25777) by debbugs.gnu.org; 3 Mar 2017 13:27:49 +0000 Original-Received: from localhost ([127.0.0.1]:37526 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjnFN-0005EM-9H for submit@debbugs.gnu.org; Fri, 03 Mar 2017 08:27:49 -0500 Original-Received: from mail-it0-f47.google.com ([209.85.214.47]:34256) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cjnFM-0005E9-AD for 25777@debbugs.gnu.org; Fri, 03 Mar 2017 08:27:48 -0500 Original-Received: by mail-it0-f47.google.com with SMTP id 207so929625ita.1 for <25777@debbugs.gnu.org>; Fri, 03 Mar 2017 05:27:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=vNuW6ys68UyA0fRPbER13MBQs/fzR357y1jrcAHJieA=; b=Wnu6da+q+O7m08dA3ekpJVXtsE5wJ8TatDprlT79e2CAmNw/Y2xl35gf0pX/Ys/1qO DQ26pH4nKZ7zdEqY3reKBA//do8ErWYcDW1ap4SUFu4xpJKg23JltZhDAZ/hXtUmzjpn qDMp+EnOmjNFPnJsMn6g6QwSjapTHtIk+T1BixYVnQ5YcZhZ3ARDs7QgyCfWMbuWBrCt 6dL5ttfRk8pdCIwmnzVDDhCYgxMi2DxgigU1kM3rmCql25iAfKRCk33cxGxoOEKkeO9f 3AUCy2c8KLuBzZzaglcu6zWdw+XiyP5dnw3vBZE7amaQsuDmoWBj7xutseR39kVgq61A RgWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=vNuW6ys68UyA0fRPbER13MBQs/fzR357y1jrcAHJieA=; b=Tj9Se5JwOey66JlCiM0xJhT8BIi9qrJKIHfebVdjmUE4NU6hjyUJrNgxITD6Grwt6p FR2M4b1GeiTpHLXloJJkOTTr2Mpi9CoIijZY//SDf1QuSdDIib6AZfCg4UuL7sWhAObd tJtUnCiCePEfurDGFLsFJCfb+aP2OUTtT7D7jDNmAfMs9EHLwAsiJM1nOlpPA3tX2Qw5 LIqU78faZEosHOVtEI5EavtvDgIUdHis0+qJp9vh0FcWVb8PGnMV/dblE1YcJUAx6j8Y 1UfXVH66Mo29s+Ma99H9YNwdy4leApNus8kNOusF67yH+udj5KmDHBYy8eTn9WICM5FR OFsQ== X-Gm-Message-State: AMke39kYFjdXI44PzorWQF4WtV4rfgvbYu8CYCi4h1t3aFBs8ZINGJUe8iAmy4qtxmH11w== X-Received: by 10.36.199.66 with SMTP id t63mr2711022itg.10.1488547662825; Fri, 03 Mar 2017 05:27:42 -0800 (PST) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id u206sm845942itc.24.2017.03.03.05.27.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Mar 2017 05:27:42 -0800 (PST) In-Reply-To: <9d559ea2-b66f-4b05-9b95-243651239e13@default> (Drew Adams's message of "Thu, 2 Mar 2017 22:29:48 -0800 (PST)") 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:130103 Archived-At: Drew Adams writes: >> And looking at the function body again, I think it's checking some other >> things, and seems to have some side effects with respect to the current >> rectangle. > > No, I don't think so. What did you have in mind? It can > reset window parameter `rectangle--point-crutches' or variable > `rectangle--mark-crutches', but I don't think those actions are > worth mentioning. Do you? I thought they might be important. I'm not really sure what the user-visible effect of those are though. But perhaps if you're not interested in them, we should just add a function that does only what you want? (defun rectangle-columns (start end) "Return cons (START-COLUMN . END-COLUMN) of rectangle columns. START and END are buffer positions of the rectangle corners." (save-excursion (let ((startcol (progn (goto-char start) (current-column))) (endcol (progn (goto-char end) (current-column)))) ;; ensure the start column is the left one. (when (< endcol startcol) (let ((col startcol)) (setq startcol endcol endcol col))) (cons starcol endcol))))