Skip navigation

This is a way to select whatever text we had just inserted inside a buffer. I forgotten this trick until now that used it again. A small tip worth annotating that might come in handy for somebody else as well:
1) yank(paste) the text “C-y”
2) mark the point where the cursor landed, (using point-to-register), do “C-x r SPC” and pick any letter ( a-z)
3) go back to the point where you initially were, by doing “C-u SPC”
4) set the mark there,“C-SPC”
5) use “C-x r j” (+ the letter picked) to go up the point where the yanked text ends inside your buffer.
6) Voila, the text yanked is highlighted ready for whatever manipulation you need to do onto it.

ps: Of course in case you pasted text at the end of the buffer is simpler,
just a matter of:
“C-u SPC”
“C-SPC” to mark
“M – >” to go to the end

UPDATE: Actually, thanks to Peter (see comment below) I learned that this is possible just doing “C-x C-x after the yank if you have transient mark mode enabled” .

About these ads

2 Comments

  1. Actually, all you should have to do is C-x C-x after the yank if you have transient mark mode enabled.

  2. Wow, thanks a bunch Peter, I never suspected that!
    It’s funny cause I did know and used “exchange-point-and-mark” frecuently in other contexts, but never crossed my mind what the manual just confirms:This command works even when the mark is not active,and it reactivates the mark.
    Thank you again for your feedback showing how much simpler doing that was in emacs!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: