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.
Entry filed under: Uncategorized. Tags: emacs, hacks, short, you probably don't want to read this.
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.
Entry filed under: Uncategorized. Tags: emacs, hacks, short, you probably don't want to read this.
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)