unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tor Kringeland <tor.a.s.kringeland@ntnu.no>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 52265@debbugs.gnu.org
Subject: bug#52265: Wishlist: Behavior of rectangles when last line is short
Date: Sat, 04 Dec 2021 21:33:25 +0100	[thread overview]
Message-ID: <m2k0gkrtyi.fsf@ntnu.no> (raw)
In-Reply-To: <87y25040a8.fsf@gnus.org>

Lars Ingebrigtsen <larsi@gnus.org> writes:

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

I should have been more clear.  I used `kill-rectangle' to kill the
region so that I can yank it as a column to the right of the three first
lines; this is done using `yank-rectangle' at the end of the first line,
after inserting a number of spaces.

> 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.

I see your point, and my example is relevant for creating CSV records,
but I think what rectangles already bring are pretty close to the
desired end result.

The crux is turning a collection of lines into columns, which you can
already do by killing/yanking rectangles.  The behavior in the first
point would be nice in general, as having the killed rectangle extend to
the end of the lines instead of just being the length of the current
line, is a nice optional feature to have, I think, which extends beyond
my CSV example.

The behavior in the second point is more geared toward this specific
example, but it's also a general one.  Basically it's about allowing the
user to optionally specify what column separator to use.  The default
one is tabs and spaces for visual alignment.  In my CSV example a comma
would be used.  And you could /e.g./ use a vertical bar for `org-mode'
tables.

As a sidenote, `org-mode' already sidesteps this last issue by having
the command `org-table-create-or-convert-from-region' which can create a
table from the resulting columns after yanking the rectangle.  Maybe
something similar could be done in `csv-mode'?  It would solve the issue
wrt. my second point, though I still think there is some general use in
being able to specify the column separator.





  reply	other threads:[~2021-12-04 20:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03 23:06 bug#52265: Wishlist: Behavior of rectangles when last line is short Tor Kringeland
2021-12-04 19:50 ` Lars Ingebrigtsen
2021-12-04 20:33   ` Tor Kringeland [this message]
2021-12-04 22:12     ` Lars Ingebrigtsen
2021-12-06  0:25       ` Tor Kringeland
2021-12-06  1:30         ` Lars Ingebrigtsen
2021-12-04 21:18 ` Alan Third
2021-12-06  0:12   ` Tor Kringeland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2k0gkrtyi.fsf@ntnu.no \
    --to=tor.a.s.kringeland@ntnu.no \
    --cc=52265@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).