GNU bug report logs - #52265
Wishlist: Behavior of rectangles when last line is short

Previous Next

Package: emacs;

Reported by: Tor Kringeland <tor.a.s.kringeland <at> ntnu.no>

Date: Fri, 3 Dec 2021 23:08:01 UTC

Severity: wishlist

Tags: moreinfo

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

Bug is archived. No further changes may be made.

Full log


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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Tor Kringeland <tor.a.s.kringeland <at> ntnu.no>
Cc: 52265 <at> debbugs.gnu.org
Subject: Re: bug#52265: Wishlist: Behavior of rectangles when last line is
 short
Date: Sat, 04 Dec 2021 20:50:39 +0100
Tor Kringeland <tor.a.s.kringeland <at> ntnu.no> writes:

> Suppose we have the following text
>
> text123
> more text
> text
> first
> second
> third  
>
> and want to turn it into
>
> text123,first
> more text,second	
> text,third
>
> using rectangles.

I'm not sure I understand.  Does Emacs have a rectangle command that
does this?  And if so, what is it called?

> 1. When moving POINT to the the empty line below the line containing
>    "third" and killing the region starting on the line with "first",
>    nothing happens.  How about having the whole region killed as a
>    rectangle in this case?

Killing the region (i.e., using `C-w') works fine for me...

> 2. Having a user option or prefix argument affecting `yank-rectangle'
>    which when active would /e.g./ prompt the user for a string to
>    insert, instead of filling the space between the lines and the yanked
>    rectangle with tabs/spaces.  Optionally, just place the given string
>    in front of the rectangle and put it at the end of the lines, without
>    worrying about visual alignment (so you wouldn't have to worry about
>    the first line being the longest).

I think this is way outside the scope of rectangles.  Your use case
seems to be to turn a series of lines into CSV columns -- but that's
better expressed through a CSV command.  You might want to group them by
two or three or four lines into columns, for instance.

So I don't think using rectangles for something like this is totally the
wrong tool, and it can't possibly work very well.  Unless I'm
misunderstanding something, which I might well be doing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 3 years and 168 days ago.

Previous Next


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