[slim-vim] ECL's gray streams working, or me misunderstanding?
Larry Clapp
larry at theclapp.org
Sun Jun 22 18:01:34 CDT 2008
On Sun, Jun 22, 2008 at 08:43:44PM +0200, Mikael Jansson wrote:
> I had a look in core form in if_ecl.c and how it tries to rebind
> *standard-output* to *vim-buf-stream* (an instance of
> vim-buf-stream).
>
> - From what I understand, the point of that is to have everything
> written to *s-o* dumped in a Vim buffer, so I executed the
> following:
>
> :e Lisp "to get a buffer named Lisp
> :ecl << EOF
> (setf (vim::buffer vim::*vim-buf-stream* (vim:current-buffer)))
> (format t "Hello, world.")
> EOF
It seems like if nothing else that should be
(setf (vim::buffer vim::*vim-buf-stream*) (vim:current-buffer))
Was that a typo in your email or in your original code?
Second, the safe-eval I have in my repository says
" (defun safe-eval (form from-ex) \n"
" \"evaluates a form, reporting any errors\" \n"
" (handler-case \n"
" (if from-ex \n"
" (progn \n"
" (when (stringp form) \n"
" (cl:setq form (read-from-string form))) \n"
" (eval form) \n"
" (fresh-line *standard-output*)) \n"
" (let ((*standard-output* *vim-buf-stream*) \n"
" (*error-output* *vim-buf-stream*)) \n"
" (eval form))) \n"
" (error (cnd) \n"
" (format t \"ERROR: ~a~%\" cnd)))) \n"
which binds *standard-output* only if from-ex is false, but as near as
I can tell from-ex would always be true. Try binding
*standard-output* to *vim-buf-stream* yourself, maybe?
-- L
More information about the slim-vim
mailing list