|
From: | Jambunathan K |
Subject: | FR: Yank rectangle, not as a rectangle but as a string. |
Date: | Wed, 05 Mar 2014 21:52:15 +0530 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
FR: Yank rectangle, not as a rectangle but as a string. ---------------------------------------------------------------- Use Case: I was trying to Org-tablize a two-column glossary. Glossary runs to 22 printed pages and after being Org-tablized has (I believe) 3000 entries or so. The glosssary.txt is created with pdftotext -layout -nopgbrk glossary.pdf See the attached files and screenshots. ---------------------------------------------------------------- Long story short: 1. C-x C-f kbd-macro.el. Install that macro. 2. C-x C-f glossary.txt 3. M-x fixup-glossary 4. You will end up with glossary-final.txt. ---------------------------------------------------------------- Crux of the matter: The interesting portion in the macro is this sequence ?\C-x ?r ?k ?\C-x ?b ?t ?e ?m ?p ?- ?1 return ?\C-x ?r ?y ?\C-x ?h ?\C-w ?\C-x ?b return down ?\C-y where I rely on a temporary buffer to "string-ize" a rectangle. ---------------------------------------------------------------- So, my question is this: Is there a way to do yank a rectangle as a string? ---------------------------------------------------------------- Interesting Titbit: This is the "inverse" operation of what the Info node says | (info "(emacs) Rectangles") | | For example, you can convert two single-column lists into a | double-column list by killing one of the single-column lists as a | rectangle, and then yanking it beside the other list.
french-english-glossary.png
Description: PNG image
glossary.txt
Description: Text document
kbd-macro.el
Description: application/emacs-lisp
glossary-final.txt
Description: Text document
[Prev in Thread] | Current Thread | [Next in Thread] |