Copy / Yank the whole Lisp form to Slime

Is there a way to copy / pull the whole form in Slime / Emacs?

For example, if I have the following function:

(myfunc (lst) (myotherfunc lst)) 

I want to dig / copy:

 (myotherfunc lst) 

causing a keyboard shortcut when my cursor is in an opening or closing bracket for this form (at the point where Slime / Emacs performs the matching in brackets).

+6
emacs lisp slime
source share
4 answers

In my Emacs, the kill-sexp function is bound to CMk . That is, considering that the point is in front of the opening delimiter of the balanced expression, simultaneously press Control, Meta and k.

The same command works in various other modes without Lisp, such as blocking blocks with delimiters in C-style mode, although the kill-sexp command may not be attached to the same keys.

+9
source share
  • CM-SPC (mark-sexp) to put a mark at the end of sexp, then copy / yank

  • CMf (forward-sexp) and CMb (backward-sexp) are useful for moving forward and backward through a balanced expression

http://www.emacswiki.org/emacs/ParenthesisMatching#toc2

+11
source share

Inactive emacs ParEdit mode does this by normal killing Ck by default. I would recommend it to any emacs + slime users.

+3
source share

You can use lispy , and then you can press n , which starts lispy-new-copy to copy

 (myotherfunc lst) 
0
source share

All Articles