[slim-vim] ECL's gray streams working, or me misunderstanding?

Mikael Jansson mail at mikael.jansson.be
Mon Jun 23 00:05:13 CDT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Larry Clapp wrote:
> 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?
>
This is what I really meant to say, typo in my e-mail.

  (setf (vim::buffer vim::*vim-buf-stream*) (vim:current-buffer))

> 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"
> 
Yup, the same as mine.

I tried always rebinding *standard-output* myself:

  (setf *standard-output* vim::*vim-buf-stream*)
  (format t "Hello World")

or

  (format vim::*vim-buf-stream* "Hello World")

Same results: I can see "U^A" in the buffer, but not the actual text.

- -- Mikael
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIXy8Js8liwIiYZggRAiFXAJ0VFDO08eTiaDxTf5khNfWXMjwFtwCcCMwh
WgnlwMo5E3vpz/wyk56Jp/w=
=/iJH
-----END PGP SIGNATURE-----


More information about the slim-vim mailing list