Hi,

On 2 Dez., 00:49, Randall R Schulz <[EMAIL PROTECTED]> wrote:
> Trying to make me look bad, eh? Well, it's not really a challenge, you
> know...

o.O Do I?

> I also noticed that there are some defined names with no source file
> ('cause they're not defined by Clojure code.) Those must be suppressed
> from the generated tags index.

Yes. And strangely these don't show up in the Repl. Running
(ns-interns 'de.kotka.cljtags) in the Repl just gives me -main and
get-definition-position. But running it from the -main function itself
I also get things like -hashcode, which don't have an associated
file. This is maybe connected to gen-class. Although I don't
understand why.

> My code, doubtlessly more naive and immature than your own, requires the
> invocation to specify a tags-file name and a source directory in
> addition to a collection of namespace names to index. It then
> constructs absolute path names to use in the tags file. That still
> doesn't not accommodate any attempt to index a set of namespaces that
> do not all reside in the same directory, which, e.g., characterizes
> Clojure Contrib.

I'm not sure whether to use absolute pathnames. Moving the
directory around would lead to the need of regeneration of the
tags file. On the other hand, one specify an absolute prefix
when generating the tags file:

de.kotka.cljtags --prefix `pwd`/src name.space.one ...

So to generate for example the tags for clojure contrib:

de.kotka.cljtags --prefix `pwd`/src --output /my/contrib/tags \
  clojure.contrib.def clojure.contrib.duck-streams \
  clojure.contrib.fcase clojure.contrib.command-line \
  ...

Concerning the filename issue, one maybe can do
a heuristic:

- Filename is identical to the last component of the
  namespace:
  => some/name/space.clj

- Filename is different form the last component of the
  namespace. Try the following:
  * some/name/file.clj exists? => Use it.
  * some/name/space/file.clj exists? => Use it
  * recursing here into some/name/space/*?

I think the first two cases should cover most of the
cases. I would pefer to exchange the first two checks,
since I think, the "normal" layout would be, that there
is some subdirectory containing "include" files. Clojure
itself on the other hand has a flat structure... Hmmm...

> I think it's probably desirable to, in general, include multiple
> namespaces in a single tags file.

This is already possible. Simply name them on the command
line, as for clojure.lang.Compile.

> And don't forget that the tags file must be sorted in simple
> lexicographic order, which does not seem to be what you get if you just
> dump symbol names into a sorted set or map. (So far, I've just been
> sorting the files afterward from the command line using the Gnu "sort"
> utility with the environment variable LC_ALL set to "C".)

Hmmm... At least for vim this seems to be not necessary. However
you are right. In the specification of the format it is stated, that
the
entries must be sorted. I missed that.

I already noticed some issues with Windows and Namespaces
containing -, eg. clojure.contrib.duck-streams. Will post an update
later on, today.

Sincerely
Meikel


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to