Emacs – select entire buffer macro

March 15, 2008 at 12:00 am 1 comment

You can use the mark-whole-buffer. This is bound to C-x h by default.

About these ads

Entry filed under: Uncategorized. Tags: , , , .

Currying, state and higher-order functions Emacs link

1 Comment Add your own

  • 1. SysKoll  |  January 11, 2009 at 1:41 am

    I had a similar problem. I use wikis a lot, and I edit my articles in emacs. When it’s time to paste the article in the wiki, I find myself marking the whole buffer, then copying it before pasting it into the browser text box with a middle-click.

    To minimize the keystrokes, I created a function that marks and copy the whole buffer, then bound it to a function key. I used F6, feel free to remap to anything else. Put this into your .emacs file. Tested with GNU emacs 21 and 22 on Linux. Should work in all good ports of Emacs.


    ;; F6 copy whole buffer
    (defun FM-copy-whole-buffer ()
    "Copy the whole buffer into the kill ring"
    (interactive)
    (mark-whole-buffer)
    (copy-region-as-kill-nomark(region-beginning) (region-end))
    )
    (global-set-key (quote [f6]) 'FM-copy-whole-buffer)

    Reply

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

Trackback this post  |  Subscribe to the comments via RSS Feed


March 2008
M T W T F S S
« Feb   Apr »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: