Re: [racket-dev] Bash Completion Broken?

2013-07-09 Thread Vincent St-Amour
At Tue, 9 Jul 2013 10:52:18 -0600,
Matthew Flatt wrote:
> 
> At Tue, 09 Jul 2013 12:23:56 -0400, Vincent St-Amour wrote:
> > Bash completion for raco setup (in
> > pkgs/plt-services/meta/contrib/completion/racket-completion.bash)
> > is currently broken. It only completes collects that are in the core.
> > I haven't tried it, but I suspect that zsh completion is similarly
> > broken.
> > 
> > To find collects to complete, the script looks for subdirectories of the
> > directories listed in `current-library-collection-paths'. On my current
> > install, these directories are:
> > 
> > /home/stamourv/src/plt/add-on/5.3.900.5/collects
> > /home/stamourv/src/plt/racket/lib/collects
> > 
> > which doesn't include package-installed collects. The first directory
> > also doesn't exist.
> > 
> > Is this a bug in `current-library-collection-paths', or should the
> > completion script use something else now?
> 
> The completion script will need to check links, too. (That was
> technically true before, but you didn't have enough links for it to
> matter.)
> 
> The example below shows how to get all top-level collection names, but
> I'm not sure that's what you want. 

The completion is used for, e.g., raco setup, so top-level collections
are probably the right thing.

I'll give that a try.

Thanks!

Vincent
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] Bash Completion Broken?

2013-07-09 Thread Matthew Flatt
At Tue, 09 Jul 2013 12:23:56 -0400, Vincent St-Amour wrote:
> Bash completion for raco setup (in
> pkgs/plt-services/meta/contrib/completion/racket-completion.bash)
> is currently broken. It only completes collects that are in the core.
> I haven't tried it, but I suspect that zsh completion is similarly
> broken.
> 
> To find collects to complete, the script looks for subdirectories of the
> directories listed in `current-library-collection-paths'. On my current
> install, these directories are:
> 
> /home/stamourv/src/plt/add-on/5.3.900.5/collects
> /home/stamourv/src/plt/racket/lib/collects
> 
> which doesn't include package-installed collects. The first directory
> also doesn't exist.
> 
> Is this a bug in `current-library-collection-paths', or should the
> completion script use something else now?

The completion script will need to check links, too. (That was
technically true before, but you didn't have enough links for it to
matter.)

The example below shows how to get all top-level collection names, but
I'm not sure that's what you want. 

To get the directories for links, use the `#:with-path?' argument to
`links', but you'll also have to sort out what to do with root links
versus single-collection links.



#lang racket/base
(require setup/dirs
 setup/link)

(define (add-directory-collections c s)
  (if (directory-exists? c)
  (for/fold ([s s]) ([p (in-list (directory-list c))]
 #:when (directory-exists? (build-path c p))
 #:when (regexp-match? #rx#"^[a-zA-Z_%+-]*$" p))
(hash-set s (path-element->string p) #t))
  s))

(define (links* m root?)
  (case m
[(user) (links #:user? #t #:root? root?)]
[(shared) (links #:shared? #t #:root? root?)]
[else (links #:file m #:root? root?)]))

(define (get-all-top-level-collections)
  (define link-modes (list* 'user 'shared (get-links-search-files)))

  (let* ([s (hash)]
 [s (for/fold ([s s]) ([c (in-list
   (current-library-collection-paths))])
  (add-directory-collections c s))]
 [s (for*/fold ([s s]) ([m (in-list link-modes)]
[l (in-list (links* m #f))])
  (hash-set s l #t))]
 [s (for*/fold ([s s]) ([m (in-list link-modes)]
[c (in-list (links* m #t))])
  (add-directory-collections c s))])
(hash-keys s)))

(get-all-top-level-collections)

_
  Racket Developers list:
  http://lists.racket-lang.org/dev


[racket-dev] Bash Completion Broken?

2013-07-09 Thread Vincent St-Amour
Bash completion for raco setup (in
pkgs/plt-services/meta/contrib/completion/racket-completion.bash)
is currently broken. It only completes collects that are in the core.
I haven't tried it, but I suspect that zsh completion is similarly
broken.

To find collects to complete, the script looks for subdirectories of the
directories listed in `current-library-collection-paths'. On my current
install, these directories are:

/home/stamourv/src/plt/add-on/5.3.900.5/collects
/home/stamourv/src/plt/racket/lib/collects

which doesn't include package-installed collects. The first directory
also doesn't exist.

Is this a bug in `current-library-collection-paths', or should the
completion script use something else now?


As a side-note, I think that plt-services/meta/contrib should be it's
own package, or maybe even three separate ones (completion, honu.vim and
rubber). If nobody objects, I'll do that.

Vincent
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] Tool warnings from raco

2013-07-09 Thread Matthew Flatt
I changed `raco setup' to use relative paths for the info-domain cache,
but not to prune away the old absolute paths.

For now, you can delete "racket/lib/info-cache.rktd", and I'll work on
a repair to `raco setup'.

At Tue, 9 Jul 2013 11:55:36 -0400, Asumu Takikawa wrote:
> Hi all,
> 
> I've suddenly started getting odd warnings from `raco` on git HEAD. Any
> idea what's going on?
> 
> warning: tool "make" registered twice: "make" and 
> # mmands>
> warning: tool "exe" registered twice: "exe" and 
> # mmands>
> warning: tool "pack" registered twice: "pack" and 
> # mmands>
> warning: tool "unpack" registered twice: "unpack" and 
> # mmands>
> warning: tool "decompile" registered twice: "decompile" and 
> # mmands>
> warning: tool "test" registered twice: "test" and 
> # mmands>
> warning: tool "expand" registered twice: "expand" and 
> # mmands>
> warning: tool "distribute" registered twice: "distribute" and 
> # mmands>
> warning: tool "ctool" registered twice: "ctool" and 
> # mmands>
> warning: tool "demodularize" registered twice: "demodularize" and 
> # mmands>
> warning: tool "docs" registered twice: "docs" and 
> # elp>
> warning: tool "check-requires" registered twice: "check-requires" and 
> # o-debugger-text-lib/macro-debugger>
> warning: tool "show-dependencies" registered twice: "show-dependencies" and 
> # o-debugger-text-lib/macro-debugger>
> warning: tool "scribble" registered twice: "scribble" and 
> # ib/scribble>
> 
> Cheers,
> Asumu
> _
>   Racket Developers list:
>   http://lists.racket-lang.org/dev
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


[racket-dev] Tool warnings from raco

2013-07-09 Thread Asumu Takikawa
Hi all,

I've suddenly started getting odd warnings from `raco` on git HEAD. Any
idea what's going on?

warning: tool "make" registered twice: "make" and 
#
warning: tool "exe" registered twice: "exe" and 
#
warning: tool "pack" registered twice: "pack" and 
#
warning: tool "unpack" registered twice: "unpack" and 
#
warning: tool "decompile" registered twice: "decompile" and 
#
warning: tool "test" registered twice: "test" and 
#
warning: tool "expand" registered twice: "expand" and 
#
warning: tool "distribute" registered twice: "distribute" and 
#
warning: tool "ctool" registered twice: "ctool" and 
#
warning: tool "demodularize" registered twice: "demodularize" and 
#
warning: tool "docs" registered twice: "docs" and 
#
warning: tool "check-requires" registered twice: "check-requires" and 
#
warning: tool "show-dependencies" registered twice: "show-dependencies" and 
#
warning: tool "scribble" registered twice: "scribble" and 
#

Cheers,
Asumu
_
  Racket Developers list:
  http://lists.racket-lang.org/dev