[slim-vim] Bug in vim+ecl

Larry Clapp larry at theclapp.org
Fri Mar 17 16:40:51 CST 2006


On Fri, Mar 17, 2006 at 10:56:43PM +0100, Eirik A. Nygaard wrote:
> vim jumps into the ecl repl if I try to call a function from a
> package where that function does not exists.
> 
> :ecl (nonexistent-function)
> => ERROR: The function NONEXISTENT-FUNCTION is undefined.
> 
> :ecl (vim:nonexistent-function)
> => Cannot find the external symbol NONEXISTENT-FUNCTION in #<"VIM" package>.
>                                                                          Broken
> at READ-FROM-STRING.
>                   > 
> 
> Looking into it, but a little unsure where to start. Please help out.

(defun vim::safe-eval (form from-ex)
  "evaluates a form, reporting any errors"
  (handler-case
    (progn
      (when (stringp form)
	(setq form (read-from-string form)))

      (if from-ex
	(progn
	  (eval form)
	  (fresh-line *standard-output*))
	(let ((*standard-output* *vim-buf-stream*)
	      (*error-output* *vim-buf-stream*))
	  (eval form))))
    (error (cnd)
	   (format t "ERROR: ~A~%" cnd))))

Jim's original VIM::SAFE-EVAL in if_ecl.c has the READ-FROM-STRING
outside the HANDLER-CASE.

Maybe we'll need something in our .vimrc's

  ecl (load "~/.vim+ecl-patches.lisp")

except I don't think CL knows about Unix's tilde convention, but I
don't know offhand how to access the environment in ECL.  But I do in
Vim :)

  exec 'ecl (load "' . $HOME . '/.vim+ecl-patches.lisp")'

Nice that Jim did so much of if_ecl in Lisp.  You can eval it right in
the editor.  Sweeeet.  :)

-- Larry



More information about the slim-vim mailing list