[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: save buffer contents without moving mark/point?
From: |
Tom Rauchenwald |
Subject: |
Re: save buffer contents without moving mark/point? |
Date: |
Mon, 26 Feb 2007 20:53:07 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) |
Thomas L Roche <tlroche@us.ibm.com> writes:
> Apologies if this is a FAQ, but I didn't see it when searching C-h F.
> I'm currently using GNU Emacs 21.2.1 (i686-pc-cygwin, X toolkit) of
> 2004-03-22 on cm-test. (Hmm, I guess I need to upgrade my cygwin.)
>
> I'm looking for a {function, key binding} with semantics like windows
> C-a, i.e. that will select the current contents of the buffer
> (preferably respecting narrowing) and save it to the kill ring without
> killing (like copy-region-as-kill).
>
> What to use? If possible please reply directly to me as well as to the
> list, and TIA.
I'm not a lisp-wizard, but this should do it:
(defun copy-buffer-to-killring ()
"Copies the contents of the current buffer to the killring"
(interactive)
(copy-region-as-kill (point-min) (point-max)))
--
Your teddy bear will eventually reveal itself to be two other people
put together. Listen to your computer this month. Today is not a
good time for not answering the phone. Never think about financial
concerns without thinking first. You'll never be happy.