March 15, 2008 at 12:00 am
You can use the mark-whole-buffer. This is bound to C-x h by default.
Entry filed under: Uncategorized. Tags: emacs, hacks, short, you probably don't want to read this.
Currying, state and higher-order functions Emacs link
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"
(global-set-key (quote [f6]) 'FM-copy-whole-buffer)
Fill in your details below or click an icon to log in:
You are commenting using your WordPress.com account. ( Log Out / Change )
You are commenting using your Twitter account. ( Log Out / Change )
You are commenting using your Facebook account. ( Log Out / Change )
You are commenting using your Google+ account. ( Log Out / Change )
Connecting to %s
Notify me of new comments via email.
Trackback this post | Subscribe to the comments via RSS Feed
Blog at WordPress.com.
Get every new post delivered to your Inbox.