I noticed an annoying behaviour when copying multiple rows (a list) from a web page into an org-mode table, following a process inspired by Is it possible to copy /paste multiple lines of text into cells of org-mode table?.
The annoying result is that the table sides don't align properly, due to a TAB character being introduced during the process. Maybe I've discovered a bug or an undesired feature.
Note: It seems that using
copy-rectangle-as-kill rather than
kill-rectangle in the process prevents the TAB from appearing.
Reproducing the behaviour
Update: Reproduced in Emacs 26.3, but not fully in 27.1. If you have Docker installed you can test yourself using:
docker run -it silex/emacs:26.3 emacs.
For version 27.1, do
docker run -it silex/emacs:27.1 emacs and note that when yanking, a TAB character is actually created/inserted after the
A. However, when you then press
C-c C-c the TAB is replaced with a suitable number of spaces.
Create an empty table and these lines of text (the number of characters matter):
| | | | A 12345678
Cut/kill the lines as a rectangle in exactly the following way:
C-x SPC) with the cursor to the left of
C-x r k) with the cursor to the right of
Yank rectangle into the table:
- Place cursor on first row
C-x r y)
It should now look like this:
| A | | 12345678 |
There should be a TAB character after the
A in the first row.
With cursor in table, align borders using
C-c C-c, giving:
| A | | 12345678 |
Oops, still unaligned.
I suspect the misalignment is due to the TAB character. But to see the effect, you have to have the right number of characters on the second row. Repeating steps above on the following two lines of text produces an aligned table without a TAB character:
A 1234567 | A | | 1234567 |
C-x r M-w) on the original two lines of text also did not result in a TAB character.