From: Jambunathan K <kjambunathan@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: FR: Yank rectangle, not as a rectangle but as a string.
Date: Wed, 05 Mar 2014 21:52:15 +0530 [thread overview]
Message-ID: <87iorssjig.fsf@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1457 bytes --]
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.
[-- Attachment #2: french-english-glossary.png --]
[-- Type: image/png, Size: 63480 bytes --]
[-- Attachment #3: glossary.txt --]
[-- Type: text/plain, Size: 1142 bytes --]
mettre à jour: to update, 13 neveu: m. nephew, 2
mettre à la porte / être mis(e) à la porte: to fire / to nez: m. nose, 4, 10
be fired, 12 nièce: f. niece, 2
mettre de côté: to put aside, to save, 13 noces: f pl, wedding, 7
meuble / meubles: m. piece of furniture / furniture, 8
COERLL - French Department Page 329 of 347 CC 2011 University of Texas at Austin
Noël, le 25 décembre / Joyeux Noël!: m. Christmas / Pâques / Joyeuses Pâques!: m, f pl, Easter / Happy
Merry Christmas! , 7 Easter!, 7
noir(e): black, 4 parc: m. park, 3, 6
noix: f. walnut, 5 parce que: because, 2
nom (de famille): m. last name, 2 parents: m pl, parents, relatives , 2
[-- Attachment #4: kbd-macro.el --]
[-- Type: application/emacs-lisp, Size: 617 bytes --]
[-- Attachment #5: glossary-final.txt --]
[-- Type: text/plain, Size: 1065 bytes --]
| mettre à jour: to update, 13 |
| mettre à la porte / être mis(e) à la porte: to fire / to |
| be fired, 12 |
| mettre de côté: to put aside, to save, 13 |
| meuble / meubles: m. piece of furniture / furniture, 8 |
| neveu: m. nephew, 2 |
| nez: m. nose, 4, 10 |
| nièce: f. niece, 2 |
| noces: f pl, wedding, 7 |
| |
Noël, le 25 décembre / Joyeux Noël!: m. Christmas / Pâques / Joyeuses Pâques!: m, f pl, Easter / Happy
Merry Christmas! , 7 Easter!, 7
noir(e): black, 4 parc: m. park, 3, 6
noix: f. walnut, 5 parce que: because, 2
nom (de famille): m. last name, 2 parents: m pl, parents, relatives , 2
next reply other threads:[~2014-03-05 16:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-05 16:22 Jambunathan K [this message]
2014-03-06 1:59 ` FR: Yank rectangle, not as a rectangle but as a string Eric Abrahamsen
2014-03-06 7:26 ` Teemu Likonen
2014-03-06 10:22 ` Teemu Likonen
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87iorssjig.fsf@gmail.com \
--to=kjambunathan@gmail.com \
--cc=help-gnu-emacs@gnu.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.