[slim-vim] Problem with :ecl in Vim-7.x

Mikael Jansson mail at mikael.jansson.be
Tue Jun 3 07:25:44 CDT 2008


Larry Clapp wrote:
> On Wed, May 28, 2008 at 04:48:51PM +0200, Mikael Jansson wrote:
>> On Wed, May 28, 2008 at 2:23 PM, Larry Clapp <larry at theclapp.org> wrote:
>>> You need to make sure that *standard-output* is bound around any
>>> :ecl call.  What you bind it to is an interesting question.  For
>>> debugging I'd probably bind it to a global string-stream that I'd
>>> print out at the end of the :ecl call.  For production, ideally
>>> you'd like a Grey stream that prints to the vim output area.
>>>
>> Wouldn't printing the string out require *standard-output*?
> 
> I meant, you capture the string by binding *standard-output* to a
> string-stream, and then you print the string via Vim's msg() function
> (or whatever it's called -- echo(), maybe?).
>
Got it!

==========
$ cat /tmp/foo.ecl
ecl << EOF
(let* ((s (make-string-output-stream))
        (*standard-output* s))

   (format t "Buffers: ~{~A~^, ~}"
     (mapcar (lambda (buffer) (vim:buffer-name :buffer buffer))
             (vim:buffers)))

   (vim:msg (get-output-stream-string s)))
EOF

$ vim
:source /tmp/foo.ecl
<ee>
Buffers: NIL
==========

Second time I :source /tmp/foo.ecl, I don't get the <ee>, though. Any 
ideas there?

----

To change the topic slightly: I might try to add if_ecl.* (and not the 
network/asynch patches) into the official Vim tree.

Would any of the original authors object? Tried getting hold of Eirik, 
but no response to the ntnu.no address I used. (I hope at least some of 
the others are lurking here on the list still).

-- 
Mikael Jansson
http://mikael.jansson.be


More information about the slim-vim mailing list