From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tor Kringeland Newsgroups: gmane.emacs.bugs Subject: bug#52265: Wishlist: Behavior of rectangles when last line is short Date: Sat, 04 Dec 2021 21:33:25 +0100 Message-ID: References: <87y25040a8.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38957"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52265@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 04 21:34:34 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mtbju-0009vU-A0 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Dec 2021 21:34:34 +0100 Original-Received: from localhost ([::1]:56046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtbjt-0006on-9S for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Dec 2021 15:34:33 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58870) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbjR-0006oO-32 for bug-gnu-emacs@gnu.org; Sat, 04 Dec 2021 15:34:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43600) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbjO-0005UH-1u for bug-gnu-emacs@gnu.org; Sat, 04 Dec 2021 15:34:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mtbjN-0000vM-VY for bug-gnu-emacs@gnu.org; Sat, 04 Dec 2021 15:34:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tor Kringeland Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Dec 2021 20:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52265 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 52265-submit@debbugs.gnu.org id=B52265.16386500153519 (code B ref 52265); Sat, 04 Dec 2021 20:34:01 +0000 Original-Received: (at 52265) by debbugs.gnu.org; 4 Dec 2021 20:33:35 +0000 Original-Received: from localhost ([127.0.0.1]:55146 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbiw-0000ug-UO for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:33:35 -0500 Original-Received: from mailgw201.it.ntnu.no ([129.241.56.178]:39152) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbiu-0000uT-Fp for 52265@debbugs.gnu.org; Sat, 04 Dec 2021 15:33:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ntnu.no; i=@ntnu.no; q=dns/txt; s=s1-1909-ntnu; t=1638650010; h=from : to : cc : subject : in-reply-to : references : date : message-id : mime-version : content-type : from; bh=rNmW7H6wpCgtYu3WDCAd22xRo9rTw/ZFPhFb632eiJI=; b=HWRbVA/e/kUk1fsgGVw8Vo7n+cFInLsl+WdnOX7NllJeRYpYyrkBB4HUtFsD5QXAdb3jE pl8hlRc4TtWpETeSmMqUkX1buPZuuiyyvEoKuVKthH9eFzbZ2yjPMvRwEzqebFN4k2Rp7vJ D3TP9t18uKa96e/B//z77T3urok7PcR/P4HkNNe3mUWRhbbHwPJ/vGKxeON7DEPs9noQdNl jbyP91XRx2kpt+F3BM7WC83LR5BQRvopkx2yhSoCZiVQ7GqTBoRb446Yqg9M+2pgMQTOuUR iyGQ4bY/uuR8IO1Js+2gUZ2x97X0GYSUzteUl0WW+2nADZ8g5Iy3aIaTaj3w== Original-Received: from localhost (localhost [127.0.0.1]) by mailgw201.it.ntnu.no (Postfix) with ESMTP id 28DE8903088; Sat, 4 Dec 2021 21:33:30 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mailgw201.it.ntnu.no Original-Received: from mailgw201.it.ntnu.no ([127.0.0.1]) by localhost (mailgw201.it.ntnu.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id B5tqy7SyGxj7; Sat, 4 Dec 2021 21:33:29 +0100 (CET) Original-Received: from localhost (unknown [95.174.66.58]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: takringe@ntnu.no) by mailgw201.it.ntnu.no (Postfix) with ESMTPSA id 459129023CF; Sat, 4 Dec 2021 21:33:29 +0100 (CET) In-Reply-To: <87y25040a8.fsf@gnus.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:221504 Archived-At: Lars Ingebrigtsen 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.