When I evaluate something, eg with C-x C-e, the result appears in the minibuffer. Is there a way I can copy it from there? It would be nice to paste it into e-mails etc, but when I press a key it disappears.
Thanks,
Tamas
Tamas K Papp wrote:
When I evaluate something, eg with C-x C-e, the result appears in the minibuffer. Is there a way I can copy it from there? It would be nice to paste it into e-mails etc, but when I press a key it disappears.
From the description of C-x C-e:
"...Interactively, with prefix argument, print output into current buffer."
So, C-u C-x C-e will print the output of the evaluated expression in the current buffer.
See also, (info "(emacs)Lisp Eval"):
"If `C-x C-e', or `M-:' is given a numeric argument, it inserts the value into the current buffer at point, rather than displaying it in the echo area. The argument's value does not matter."
On Sat, 02 May 2009 12:36:51 -0400, Mark Harig wrote:
Tamas K Papp wrote:
When I evaluate something, eg with C-x C-e, the result appears in the minibuffer. Is there a way I can copy it from there? It would be nice to paste it into e-mails etc, but when I press a key it disappears.
From the description of C-x C-e:
"...Interactively, with prefix argument, print output into current buffer."
So, C-u C-x C-e will print the output of the evaluated expression in the current buffer.
See also, (info "(emacs)Lisp Eval"):
"If `C-x C-e', or `M-:' is given a numeric argument, it inserts the value into the current buffer at point, rather than displaying it in the echo area. The argument's value does not matter."
Thank you Mark (and also Dmitry). This works, but it is a bit inconvenient, eg if I am evaluating a SEXP that is inside another one, then the result is inserted there, eg using C-u C-x C-e before the last ) on (+ 1 (+ 2 3)) gives (+ 1 (+ 2 3)5).
Is there a way to put the output either in the killring or a register?
Thanks,
Tamas
* Tamas K Papp gti5eg$iv$1@ger.gmane.org : Wrote on Sat, 2 May 2009 19:03:44 +0000 (UTC):
|>> When I evaluate something, eg with C-x C-e, the result appears in the |>> minibuffer. Is there a way I can copy it from there? It would be nice |>> to paste it into e-mails etc, but when I press a key it disappears. | | Is there a way to put the output either in the killring or a register?
Do you want to grab the output or do you want to grab the result? You could tweak the following:
(define-key slime-mode-map "\C-x\C-e" (lambda () "Evaluate the expression preceding point. Copies result to kill ring." (interactive) (destructuring-bind (output results) (slime-eval `(swank:eval-and-grab-output ,(slime-last-expression))) (message "--> %S\n==> %S" output results) (kill-new results) results))) -- Madhu
On Суббота 02 мая 2009 18:42:32 Tamas K Papp wrote:
When I evaluate something, eg with C-x C-e, the result appears in the minibuffer. Is there a way I can copy it from there? It would be nice to paste it into e-mails etc, but when I press a key it disappears.
You can switch to *Messages* buffer (`C-x b *Messages*' or click the mini-buffer with the mouse), all messages (including form evaluation) go there and do not disappear.