unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* save buffer contents without moving mark/point?
       [not found] <200702261706.l1QH6WiM031013@e36.co.us.ibm.com>
@ 2007-02-26 19:14 ` Thomas L Roche
  2007-02-26 19:53   ` Tom Rauchenwald
       [not found] ` <mailman.130.1172517269.7795.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas L Roche @ 2007-02-26 19:14 UTC (permalink / raw)
  To: help-gnu-emacs

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: save buffer contents without moving mark/point?
       [not found] ` <mailman.130.1172517269.7795.help-gnu-emacs@gnu.org>
@ 2007-02-26 19:43   ` james
  2007-02-26 23:41   ` B. T. Raven
  2007-02-27  7:02   ` Mathias Dahl
  2 siblings, 0 replies; 5+ messages in thread
From: james @ 2007-02-26 19:43 UTC (permalink / raw)
  To: help-gnu-emacs

On Feb 26, 1:14 pm, Thomas L Roche <tlro...@us.ibm.com> wrote:
> 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).

(defun my-select-all ()
  (interactive)
  (copy-region-as-kill (point-min) (point-max)))

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: save buffer contents without moving mark/point?
  2007-02-26 19:14 ` save buffer contents without moving mark/point? Thomas L Roche
@ 2007-02-26 19:53   ` Tom Rauchenwald
  0 siblings, 0 replies; 5+ messages in thread
From: Tom Rauchenwald @ 2007-02-26 19:53 UTC (permalink / raw)
  To: help-gnu-emacs

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: save buffer contents without moving mark/point?
       [not found] ` <mailman.130.1172517269.7795.help-gnu-emacs@gnu.org>
  2007-02-26 19:43   ` james
@ 2007-02-26 23:41   ` B. T. Raven
  2007-02-27  7:02   ` Mathias Dahl
  2 siblings, 0 replies; 5+ messages in thread
From: B. T. Raven @ 2007-02-26 23:41 UTC (permalink / raw)
  To: help-gnu-emacs


"Thomas L Roche" <tlroche@us.ibm.com> wrote in message
news:mailman.130.1172517269.7795.help-gnu-emacs@gnu.org...
> 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 think M-w already does that:

M-w runs the command copy-region-as-kill-nomark
   which is an interactive compiled Lisp function in `pc-select'.
(copy-region-as-kill-nomark BEG END)

This is for Motif, Mac, MS Windows like behavior but you should be able to
use it under Linux or Cygwin too.

Ed

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: save buffer contents without moving mark/point?
       [not found] ` <mailman.130.1172517269.7795.help-gnu-emacs@gnu.org>
  2007-02-26 19:43   ` james
  2007-02-26 23:41   ` B. T. Raven
@ 2007-02-27  7:02   ` Mathias Dahl
  2 siblings, 0 replies; 5+ messages in thread
From: Mathias Dahl @ 2007-02-27  7:02 UTC (permalink / raw)
  To: help-gnu-emacs

Thomas L Roche <tlroche@us.ibm.com> writes:

> 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).

C-x h ;; Marks whole buffer
M-w   ;; Save region to kill ring

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-02-27  7:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200702261706.l1QH6WiM031013@e36.co.us.ibm.com>
2007-02-26 19:14 ` save buffer contents without moving mark/point? Thomas L Roche
2007-02-26 19:53   ` Tom Rauchenwald
     [not found] ` <mailman.130.1172517269.7795.help-gnu-emacs@gnu.org>
2007-02-26 19:43   ` james
2007-02-26 23:41   ` B. T. Raven
2007-02-27  7:02   ` Mathias Dahl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).