From: Jonathon McKitrick
Subject: Would kill-sexp-save be useful?
Date: 
Message-ID: <1137531639.605558.71980@g43g2000cwa.googlegroups.com>
I looked in paredit.el and didn't find this...
but wouldn't it be nice to have an equivalent of M-space and then M-w?

There are times when I want to copy an entire sexp to the kill ring and
then insert it later, without deleting it at the original location.

From: Jason Kantz
Subject: Re: Would kill-sexp-save be useful?
Date: 
Message-ID: <1137539230.522540.164220@g49g2000cwa.googlegroups.com>
I'm not sure what you mean by M-space then M-w, but placing point on an
opening paren and using mark-sexp (ESC ··@) will mark the entire
expression.  You can then use M-w to save it to the kill-ring.

You can also double click on the opening paren to mark the expression.
From: Jonathon McKitrick
Subject: Re: Would kill-sexp-save be useful?
Date: 
Message-ID: <1137548500.704551.179300@g47g2000cwa.googlegroups.com>
Jason Kantz wrote:
> I'm not sure what you mean by M-space then M-w, but placing point on an
> opening paren and using mark-sexp (ESC ··@) will mark the entire
> expression.  You can then use M-w to save it to the kill-ring.
>
> You can also double click on the opening paren to mark the expression.

Close enough!  thanks!
From: Timofei Shatrov
Subject: Re: Would kill-sexp-save be useful?
Date: 
Message-ID: <43cdf318.3104435@news.readfreenews.net>
On 17 Jan 2006 13:00:39 -0800, "Jonathon McKitrick"
<···········@bigfoot.com> tried to confuse everyone with this message:

>I looked in paredit.el and didn't find this...
>but wouldn't it be nice to have an equivalent of M-space and then M-w?
>
>There are times when I want to copy an entire sexp to the kill ring and
>then insert it later, without deleting it at the original location.
>

I made a keyboard macro to solve this. It became one of the most common
key combinations that I use. 

(fset 'copy-sexp
   [?\C-\M-  ?\M-w])
(global-set-key [24 99] 'copy-sexp) ;;Binds to C-x c

--
|WAR HAS NEVER SOLVED ANYTHING|,----- Timofei Shatrov aka Grue---------.
|(except for ending slavery,  ||mail: grue at mail.ru ================ |
|   fascism and communism)    ||============= http://grue3.tripod.com  |
|...and Saddam's dictatorship |`----------------------------------[4*72]
From: senator
Subject: Re: Would kill-sexp-save be useful?
Date: 
Message-ID: <1137574393.645903.159770@z14g2000cwz.googlegroups.com>
Here's another one that I use - no keybinding etc required, just
"behavioural modifications". I just do in quick succession, kill-sexp &
paste sexp (back in the same place), then I have it in the kill-ring.
Quickly C-k, then C-y, yeah? I do that a lot. It's inelegant, but it
does save on my limited key-bindings.

Been thinking about something that does kill-previous-sexp though.
Perhaps that could be useful, hmm, don't know. It's always hard trying
to figure out the most comfortable, or easily remember key-binding....
From: Thomas A. Russ
Subject: Re: Would kill-sexp-save be useful?
Date: 
Message-ID: <ymioe29gwt3.fsf@sevak.isi.edu>
"senator" <···············@gmail.com> writes:

> 
> Here's another one that I use - no keybinding etc required, just
> "behavioural modifications". I just do in quick succession, kill-sexp &
> paste sexp (back in the same place), then I have it in the kill-ring.
> Quickly C-k, then C-y, yeah? I do that a lot. It's inelegant, but it
> does save on my limited key-bindings.
> 
> Been thinking about something that does kill-previous-sexp though.

C-M-Delete    is what is built-in to Emacs.

> Perhaps that could be useful, hmm, don't know. It's always hard trying
> to figure out the most comfortable, or easily remember key-binding....



-- 
Thomas A. Russ,  USC/Information Sciences Institute
From: senator
Subject: Re: Would kill-sexp-save be useful?
Date: 
Message-ID: <1137675958.830293.274090@g14g2000cwa.googlegroups.com>
>> Here's another one that I use - no keybinding etc required, just
>> "behavioural modifications". I just do in quick succession, kill-sexp &
>> paste sexp (back in the same place), then I have it in the kill-ring.
>> Quickly C-k, then C-y, yeah? I do that a lot. It's inelegant, but it
>> does save on my limited key-bindings.

Beware, this has problems with successive sexp-kills (they get combined
into the same "clipboard", so pasting again will paste all the sexps
previously killed consecutively, not just the last one.


>
>C-M-Delete    is what is built-in to Emacs.
>

Ouch, that shut-down my x-windows abruptly...

I've settled on a more comfortable key-binding. Thanks for the tip.

(define-key slime-mode-map (kbd "C-<backspace>") 'backward-kill-sexp)

This is now inside my
(defun myslimemappings () ... lots of define-keys ...)
which gets hooked on to
(add-hook 'emacs-lisp-mode-hook 'myslimemappings)
(add-hook 'lisp-mode-hook 'myslimemappings)

for those who might be interested.


Okies, keep cdring people.
From: Johan Bockgård
Subject: Re: Would kill-sexp-save be useful?
Date: 
Message-ID: <yoij1wz4nqsu.fsf@linus003.dd.chalmers.se>
"senator" <···············@gmail.com> writes:

>> C-M-Delete is what is built-in to Emacs.
>
> Ouch, that shut-down my x-windows abruptly...

Yup.

    [Emacs 22 (CVS) etc/NEWS]

    ** The old bindings C-M-delete and C-M-backspace have been
    deleted, since there are situations where one or the other will
    shut down the operating system or your X server.

-- 
Johan Bockgård
From: Jonathon McKitrick
Subject: Re: Would kill-sexp-save be useful?
Date: 
Message-ID: <1137590919.120975.10150@o13g2000cwo.googlegroups.com>
Timofei Shatrov wrote:
> I made a keyboard macro to solve this. It became one of the most common
> key combinations that I use.
>
> (fset 'copy-sexp
>    [?\C-\M-  ?\M-w])
> (global-set-key [24 99] 'copy-sexp) ;;Binds to C-x c

Perfect.  Thanks!
> |WAR HAS NEVER SOLVED ANYTHING|,----- Timofei Shatrov aka Grue---------.
> |(except for ending slavery,  ||mail: grue at mail.ru ================ |
> |   fascism and communism)    ||============= http://grue3.tripod.com  |
> |...and Saddam's dictatorship |`----------------------------------[4*72]

Hear, hear.