Hi Albert,

Am 13.03.2009 um 13:42 schrieb Albert Cardona:

If I open a .clj file without the ng server running, it complains loudly and does not switch on syntax highlighting for clojure. Why no syntax on?

This happens for me if I open a file via the NerdTree plugin.
I'm not sure why this is happening. A simple :e will fix it. But
I would file this currently under "don't do it", ie. if you set
clj_want_gorilla, make sure the server is running. I will try
to make this more robust, so when no server is running the
fallback is the static behaviour as without clj_want_gorilla.
(Or start a server, depending on how easily this can be
done from inside vim)

Then I acess a .clj file. It 'works' fine, but I can't execute anything.
Here's a snipped of a file test/patch.clj, opened from vim as "vim
test/patch.clj", plus the overlayed error mesage triggered on pushing
\ef to execute the whole file:

This is no problem of your script nor is it a problem of vimclojure.
This is a misuse of \ef although a very subtle one. I will add a
note to the documentation. Let me explain:

-----8<------------
(ns test.patch
 (:import (ij.gui OvalRoi Roi ShapeRoi)
          (ij IJ ImagePlus)
          (ij.process ByteProcessor)
          (ini.trakem2.display Display Patch Selection)
          (mpicbg.trakem2.transform MovingLeastSquaresTransform)))

----8<--------------

When evaluating the file, vimclojure first tries to change the
namespace to test.patch. This namespace is not loaded and
hence you get an error. (When you execute the ng command
from the error message manually, will get a corresponding
exception from the clojure side).

But we cannot simply create the namespace if it doesn't exist.
Consider a second file, which is loaded for the namespace
via the :load directive in the ns form. In this file there is only
a in-ns at the top. Imagine we simply created the namespace
and evaled the code. Then all the above imports were missing.

So the Right Way is to use \rf (RequireFile) the first time to
set up the namespace correctly (it is loaded via a require
call). Then you may use \ef to reload single files afterwards.

It is important to understand that \el (EvalLine), \eb (EvalBlock),
\ep (EvalParagraph) and \ef (EvalFile) do not work on
the structure of the code like \rf, \et or \me do. I added them
because they were requested, but you have to take care that
you pay attention to what you are doing. Although I admit
that this case is a little bit tricky.

I will point this out more clearly in the documentation.

Sincerely
Meikel

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to