GNU bug report logs - #25777
25.1; [PATCH] `rectangle--pos-cols' should not move point

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Fri, 17 Feb 2017 17:52:01 UTC

Severity: wishlist

Tags: fixed

Found in version 25.1

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #56 received at 25777 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 25777 <at> debbugs.gnu.org
Subject: Re: bug#25777: 25.1;
 [PATCH] `rectangle--pos-cols' should not move point
Date: Fri, 03 Mar 2017 08:28:55 -0500
Drew Adams <drew.adams <at> oracle.com> 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))))




This bug report was last modified 6 years and 25 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.