kickingvegas / casual-editkit

Casual EditKit is a Transient library for Emacs editing commands.
GNU General Public License v3.0
9 stars 2 forks source link

Rectangle selection doesn't copy #27

Open artelse opened 2 hours ago

artelse commented 2 hours ago

As the title says, when I make a rectangle selection in an org table and hit c, the text isn't copied to the clipboard.

kickingvegas commented 2 hours ago

@artelse Rectangle operations are treated differently for copying and killing.

From the Emacs info on Rectangles:

"Killing a rectangle is not killing in the usual sense; the rectangle is not stored in the kill ring, but in a special place that only records the most recent rectangle killed. This is because yanking a rectangle is so different from yanking linear text that different yank commands have to be used. Yank-popping is not defined for rectangles."

Does this clarify? If so then please close this issue.

artelse commented 2 hours ago

When I do the same rectangle selection, regular, not via editkit, and copy the text, it just works as expected, it ends up on the clipboard and can paste (yank) it where I like.

kickingvegas commented 2 hours ago

@artelse What command/binding are you using to copy the text? If you are using copy-rectangle-as-kill and the content is in the kill ring, then your local behavior deviates from what is documented above and I am at a loss to explain/help.

artelse commented 1 hour ago

I use rectangle-mark-mode C-x SPC and then the regular copy M-w.

kickingvegas commented 1 hour ago

@artelse I appreciate you sharing this, however I think you need to realign your understanding of rectangle operations.

As mentioned above, copying and killing rectangles is different from regular text. Instead of M-w, you need to use the binding C-x r M-w to copy the rectangle.

Pasting (yanking) the rectangle also requires a special command yank-rectangle, bound to C-x r y.

Please do a deep read of https://www.gnu.org/software/emacs/manual/html_node/emacs/Rectangles.html to get a better understanding of rectangle operations.

Regards -

Charles