My configuration is slime 2.0 + sbcl 0.9.12. When I enter something like this at the REPL prompt:
CL-USER>line1 to be erased line 2 to be erased
How do I erase the lines without using the backspace key and get back to the REPL prompt?
Doug
--------------------------------- Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.
doug arro doug_arro@yahoo.com wrote:
My configuration is slime 2.0 + sbcl 0.9.12. When I enter something like this at the REPL prompt:
CL-USER>line1 to be erased line 2 to be erased
How do I erase the lines without using the backspace key and get back to the REPL prompt?
C-c C-u
(It's also in the context menu as "Kill Current Input".)
You can explore which keys do what for any given buffer by typing C-h b and searching for likely-looking function names. You can retrieve the documentation for a function by hitting C-h f.
+ slime-list@abbrvtd.org.uk (Duncan Harvey):
| C-c C-u | | (It's also in the context menu as "Kill Current Input".)
Ah, I had overlooked that one.
| You can explore which keys do what for any given buffer by typing | C-h b | and searching for likely-looking function names. You can retrieve | the documentation for a function by hitting C-h f.
Or, now that help output is nicely hyperlinked, just click on the function name next to the key sequence in the help buffer. There is even a [back] button in the resulting help buffer to get you back to the list, in case the function turned out to be irrelevant.
- Harald
Harald Hanche-Olsen hanche@math.ntnu.no wrote:
- slime-list@abbrvtd.org.uk (Duncan Harvey):
| You can explore which keys do what for any given buffer by typing | C-h b | and searching for likely-looking function names. You can retrieve | the documentation for a function by hitting C-h f.
Or, now that help output is nicely hyperlinked, just click on the function name next to the key sequence in the help buffer.
I'm a stinking XEmacs user, so for me, no... ;-)
+ doug arro doug_arro@yahoo.com:
| My configuration is slime 2.0 + sbcl 0.9.12. When I enter something | like this at the REPL prompt: | | CL-USER>line1 to be erased | line 2 to be erased | | How do I erase the lines without using the backspace key and get | back to the REPL prompt?
This seems to me more an emacs question than a slime question. To ask about general emacs editing commands, an emacs newsgroup or mailing list seems more appropriate.
The obvious answer is to use the standard emacs editing commands. For example, mark the text and hit C-w.
Slime does have one or two movement commands that might help.
From the text you get with C-h m:
C-c C-n slime-repl-next-prompt C-c C-p slime-repl-previous-prompt
So perhaps the easiest in your case, assuming that the cursor is not alread at the start of the first line, is C-c C-p C-k C-k C-k C-k (i.e., move to the prompt and kill the two lines).
Many experienced lispers prefer an editing style in which parentheses are always balanced. Insert a new pair with M-(, move up or down a level with C-M-u or C-M-d, mark a whole subexpression with C-M-space, etc. So if you have this situation
cl-user> (defun foo () (bar))
with the cursor just after the symbol BAR, C-M-u C-M-u C-M-space C-W will kill the whole expression. (Turn on transient-mark-mode to improve the experience.) Or, to combine this with my previous tip, C-C C-p C-M-space C-W is perhaps the quickest way.
- Harald
I'll stop spamming the list after this one, I promise.
+ Harald Hanche-Olsen hanche@math.ntnu.no:
| Many experienced lispers prefer an editing style in which parentheses | are always balanced. Insert a new pair with M-(, move up or down a | level with C-M-u or C-M-d, mark a whole subexpression with C-M-space, | etc.
When you do this in the repl buffer, you need to type C-j instead of return to insert newlines, since return sends the input if it looks complete. It takes a little while to get used to. I am considering rebinding the keys in the slime-repl buffer so plain return just inserts a newline. One can always use M-return to send the input.
- Harald
Harald Hanche-Olsen hanche@math.ntnu.no writes:
When you do this in the repl buffer, you need to type C-j instead of return to insert newlines, since return sends the input if it looks complete. It takes a little while to get used to. I am considering rebinding the keys in the slime-repl buffer so plain return just inserts a newline. One can always use M-return to send the input.
-1
for me sending a completed form to the lisp happens far far more often than inserting a newline in an already existing form.
Marco Baringer mb@bese.it writes:
When you do this in the repl buffer, you need to type C-j instead of return to insert newlines, since return sends the input if it looks complete. It takes a little while to get used to. I am considering rebinding the keys in the slime-repl buffer so plain return just inserts a newline. One can always use M-return to send the input.
-1
for me sending a completed form to the lisp happens far far more often than inserting a newline in an already existing form.
Agreed.
I might be willing to believe otherwise for cases where the point is inside the expression, though.
Example: (^ is the point)
(foo)^ -> send (foo^) -> insert newline
Just a thought, I'm personally not bothered by C-j.
Cheers,
-- Nikodemus Schemer: "Buddha is small, clean, and serious." Lispnik: "Buddha is big, has hairy armpits, and laughs."
Nikodemus Siivola nikodemus@random-state.net writes:
I might be willing to believe otherwise for cases where the point is inside the expression, though.
that is an excellent idea! trivial to implement too :)
Example: (^ is the point)
(foo)^ -> send (foo^) -> insert newline
Just a thought, I'm personally not bothered by C-j.
C-j and M-RET still exist when you want to force one thing or the other.
Marco Baringer mb@bese.it writes:
Nikodemus Siivola nikodemus@random-state.net writes:
I might be willing to believe otherwise for cases where the point is inside the expression, though.
that is an excellent idea! trivial to implement too :)
Example: (^ is the point)
(foo)^ -> send (foo^) -> insert newline
Just a thought, I'm personally not bothered by C-j.
C-j and M-RET still exist when you want to force one thing or the other.
I just downloaded slime from CVS and I see that you already implemented it. I think that this idea does not work very well in combination with paredit mode, where one does not manually close parantheses and the point usually remains in the expression even if this has been completed. Using paredit, one has to force sending the input all the time.
I did not find a configuration option to change this behaviour and modified my local copy of slime.el to revert to the old behaviour. But maybe I'm doing something wrong -- I'm new to SLIME. Is there a way to bind RET to the old behaviour? Or, if not, would you consider adding an option for enabling/disabling this feature?
Best regards
Giorgos
Giorgos Pontikakis gnp@freemail.gr writes:
I just downloaded slime from CVS and I see that you already implemented it. I think that this idea does not work very well in combination with paredit mode, where one does not manually close parantheses and the point usually remains in the expression even if this has been completed. Using paredit, one has to force sending the input all the time.
oh, hadn't though about that (i'm a big fan of paredit but don't use it in the repl).
I did not find a configuration option to change this behaviour and modified my local copy of slime.el to revert to the old behaviour. But maybe I'm doing something wrong -- I'm new to SLIME. Is there a way to bind RET to the old behaviour? Or, if not, would you consider adding an option for enabling/disabling this feature?
I added a slime-repl-return-behaviour variable, set it to :send-if-complete for the old behaviour, :send-only-if-after-complete for the "new" behaviour. This variable is customizable (in the slime-repl group).
paredit and slime should work seemlessly with each other, yell if things are still weird.
Marco Baringer mb@bese.it writes:
Giorgos Pontikakis gnp@freemail.gr writes:
I just downloaded slime from CVS and I see that you already implemented it. I think that this idea does not work very well in combination with paredit mode, where one does not manually close parantheses and the point usually remains in the expression even if this has been completed. Using paredit, one has to force sending the input all the time.
oh, hadn't though about that (i'm a big fan of paredit but don't use it in the repl).
I know, I learned about paredit when I watched your excellent movie :-)
I did not find a configuration option to change this behaviour and modified my local copy of slime.el to revert to the old behaviour. But maybe I'm doing something wrong -- I'm new to SLIME. Is there a way to bind RET to the old behaviour? Or, if not, would you consider adding an option for enabling/disabling this feature?
I added a slime-repl-return-behaviour variable, set it to :send-if-complete for the old behaviour, :send-only-if-after-complete for the "new" behaviour. This variable is customizable (in the slime-repl group).
paredit and slime should work seemlessly with each other, yell if things are still weird.
Everything seems ok now -- thank you!
-- Giorgos
On Tue May 16, 2006 at 09:44:34PM +0300, Giorgos Pontikakis wrote:
Marco Baringer mb@bese.it writes:
Giorgos Pontikakis gnp@freemail.gr writes:
<snip>
oh, hadn't though about that (i'm a big fan of paredit but don't use it in the repl).
I know, I learned about paredit when I watched your excellent movie :-)
I had made a mental note to install paredit when I watched that movie, and then promptly forgot about it. The note above reminded me of it again and I just installed it. That is one *slick* edit mode, I'll tell you what!
Thanks!
I had to comment out the key-binding that took over "M-;" (I couldn't quite figure out what he's doing with it). I like to be able to comment out multiple lines of code with a single key-stroke (so to speak) and it eliminated that capability w/o seeming to offer another way to do this.
-Jeff