2012-07-05 56 views
2

我認識到,泥是高級Lisp的互動模式,但我不知道是否有一個「Lisp的互動」緩衝與Common Lisp的工作方式類似於*刮*緩衝區可與的Emacs Lisp緩衝區。 I.E.在窗體的末尾敲擊C-j會將該窗體的結果插入到當前緩衝區中。*刮*煤泥

我問,因爲根據需要,我覺得編輯輸出更容易這種方式比用REPL。

回答

1

綁定此功能CJ確實是我在尋找的行爲:

(defun slime-eval-print-last-sexp() 
    (interactive) 
    (newline) 
    (insert (cadr (slime-eval `(swank:eval-and-grab-output ,(slime-last-expression))))) 
    (newline)) 
+0

'煤泥-EVAL-最後expression'已經存在於'SLIME'及其 行爲是一樣的'EVAL-最後sexp'。 – Daimrod

+0

煤泥-EVAL-最後表達不返回它的輸出,僅將其打印到小緩衝區。我不得不尋找獲得實際評估結果的方法,並提出了上述建議。 –

+0

看起來這已經與煤泥-EVAL-打印最後表達存在,但我沒有找到它,它不打印最終換行符,但它相當接近。 –

4

的Mxslime-scratchRET雖然我不知道 默認什麼呢CJ,因爲我用 Paredit

然而C-ùC-XC-è做你 都*scratch**slime-scratch*想要什麼。

It is bound to C-x C-e. 

(eval-last-sexp EVAL-LAST-SEXP-ARG-INTERNAL) 

Evaluate sexp before point; print value in minibuffer. 
Interactively, with prefix argument, print output into current buffer. 
Truncates long output according to the value of the variables 
`eval-expression-print-length' and `eval-expression-print-level'. 

(和它在*slime-scratch*緩衝slime-eval-last-expression

+0

我接過來一看,通過煤泥文檔試圖找到一些像泥劃傷,但不能。很明顯,謝謝。 –