- allow tab-completion to work for all clojure namespaces.

This commit is contained in:
jasper 2011-11-30 19:40:28 +00:00
parent 1532a55649
commit aab87b92af
4 changed files with 686 additions and 4 deletions

View File

@ -1,9 +1,10 @@
# $OpenBSD: Makefile,v 1.12 2011/10/21 16:23:45 espie Exp $
# $OpenBSD: Makefile,v 1.13 2011/11/30 19:40:28 jasper Exp $
COMMENT = Lisp-1 dialect for the Java Virtual Machine
V = 1.3.0
DISTNAME = clojure-${V}
REVISION = 0
EXTRACT_SUFX = .zip
PKG_ARCH = *
@ -35,6 +36,11 @@ NO_REGRESS = Yes
CLOJURE_HOME = ${PREFIX}/clojure
# Completions file created with:
# (def completions (mapcat (comp keys ns-publics) (all-ns)))
# (with-open [f (java.io.BufferedWriter. (java.io.FileWriter. "clj_completions"))]
# (.write f (apply str (interpose \newline completions))))
do-install:
${INSTALL_DATA_DIR} ${CLOJURE_HOME}
${INSTALL_DATA} ${WRKSRC}/clojure.jar ${CLOJURE_HOME}
@ -43,5 +49,6 @@ do-install:
${PREFIX}/bin/clojure
cd ${WRKDIST} && tar -cf - src | tar -C ${CLOJURE_HOME} -xf -
chown -R ${SHAREOWN}:${SHAREGRP} ${CLOJURE_HOME}/src
${INSTALL_DATA} ${FILESDIR}/clj_completions ${CLOJURE_HOME}
.include <bsd.port.mk>

View File

@ -0,0 +1,673 @@
formatter-out
formatter
*print-radix*
get-pretty-writer
*print-miser-width*
*print-pprint-dispatch*
print-table
write
print-length-loop
write-out
simple-dispatch
pprint-indent
cl-format
code-dispatch
pprint
*print-suppress-namespaces*
fresh-line
*print-right-margin*
*print-pretty*
pp
with-pprint-dispatch
*print-base*
pprint-newline
pprint-logical-block
set-pprint-dispatch
pprint-tab
walk
prewalk-demo
postwalk-demo
keywordize-keys
stringify-keys
prewalk
postwalk
postwalk-replace
macroexpand-all
prewalk-replace
completions
repl-exception
stack-element-str
repl-caught
demunge
load-script
skip-whitespace
skip-if-eol
repl-read
with-bindings
root-cause
repl-prompt
repl
main
sorted-map
read-line
re-pattern
keyword?
unchecked-inc-int
val
chunked-seq?
find-protocol-impl
vector-of
object-array
*compile-path*
max-key
list*
ns-aliases
booleans
the-ns
==
chunk-buffer
longs
shorts
instance?
format
sequential?
fn?
empty
bound-fn
dorun
time
remove-method
gensym
not=
*3
unchecked-multiply
doseq
bit-or
aset-byte
if-not
hash-set
->Vec
add-watch
unchecked-dec
some
nil?
string?
boolean-array
second
letfn
keys
for
*2
long-array
pop-thread-bindings
error-mode
cond
bit-set
spit
find-protocol-method
fn
sorted?
short-array
ns-unalias
ns-publics
EMPTY-NODE
char-array
dosync
all-ns
long
with-open
init-proxy
add-classpath
false?
await1
true?
gen-interface
sync
short
ns-unmap
repeat
zipmap
distinct
get-in
bit-xor
char-escape-string
complement
let
get-validator
dotimes
ref-max-history
*ns*
promise
defmethod
-'
pop!
derive
aset-float
extend
-reset-methods
lazy-cat
commute
defstruct
with-in-str
partition-by
rem
odd?
symbol?
*print-level*
*allow-unresolved-vars*
thread-bound?
proxy-call-with-super
*unchecked-math*
ns-interns
re-matches
split-with
munge
loop
future-done?
next
import
deliver
symbol
vals
->ArrayChunk
select-keys
re-matcher
rand
deref
unchecked-inc
*math-context*
read
sequence
make-hierarchy
+
number?
assoc!
descendants
into-array
last
some-fn
unchecked-negate
integer?
defrecord
*read-eval*
alter
prn
with-meta
with-out-str
floats
*
*compile-files*
when-not
butlast
-
->>
reversible?
rseq
send-off
seq?
refer-clojure
identical?
..
print
vary-meta
with-loading-context
agent-error
*command-line-args*
bit-flip
zero?
bit-and
unquote-splicing
future
re-groups
*warn-on-reflection*
newline
replicate
keep-indexed
char?
distinct?
remove-ns
ratio?
xml-seq
vec
concat
update-in
vector
with-bindings*
conj
bases
with-redefs
/
unchecked-add
ref-set
assoc
unchecked-remainder-int
seque
aset-char
boolean
read-string
neg?
float-array
doubles
isa?
future-call
doto
extends?
remove-watch
print-str
*e
ref-history-count
rsubseq
*flush-on-newline*
*out*
future?
vector?
split-at
chunk-cons
ns-refers
create-struct
proxy-super
int-array
unchecked-long
float
assert
map
+'
counted?
memfn
double-array
accessor
*print-length*
frequencies
chars
class?
rand-int
*1
aset-short
unchecked-short
prn-str
iterate
chunk-append
when-first
unchecked-double
slurp
restart-agent
unchecked-int
mapcat
assoc-in
get-thread-bindings
special-symbol?
ref
conj!
find-var
inc
future-cancel
every-pred
definline
bound-fn*
unchecked-subtract
ns-name
shuffle
defn-
*file*
re-find
bit-not
construct-proxy
ref-min-history
destructure
seq
intern
unchecked-multiply-int
pvalues
to-array-2d
sorted-map-by
filter
->VecNode
*verbose-defrecords*
*clojure-version*
var?
alter-meta!
unchecked-dec-int
comment
key
class
re-seq
-cache-protocol-fn
ns
empty?
test
print-dup
create-ns
name
list?
nthrest
aset
nnext
doall
extenders
macroexpand-1
not-any?
resultset-seq
reductions
into
with-precision
*use-context-classloader*
transient
ffirst
bit-clear
proxy-name
extend-type
load-reader
with-redefs-fn
or
hash
inc'
print-ctor
associative?
float?
drop-last
replace
decimal?
defn
parents
map?
prefers
numerator
condp
quot
chunk-rest
unchecked-negate-int
file-seq
send
with-local-vars
reverse
with-bindings
count
get-proxy-class
set
unchecked-subtract-int
when-let
comp
nth
byte
dissoc!
*err*
constantly
load
namespace
pr-str
<
rationalize
sort-by
->VecSeq
cycle
peek
denominator
reduce
interleave
amap
->
cons
macroexpand
var-set
str
aset-boolean
ns-imports
while
remove-all-methods
first
bean
=
memoize
var-get
unchecked-float
range
tree-seq
defmacro
set-validator!
aset-double
*'
case
unchecked-divide-int
enumeration-seq
prefer-method
partition-all
ensure
find-ns
not-every?
struct-map
>
max
proxy-mappings
identity
ints
fnext
biginteger
min-key
reset-meta!
push-thread-bindings
unchecked-add-int
subs
compile
agent-errors
clear-agent-errors
printf
ns-resolve
method-sig
>=
shutdown-agents
reset!
even?
require
bit-shift-left
dec'
methods
future-cancelled?
compare
deftype
sorted-set-by
cast
namespace-munge
supers
pcalls
load-string
group-by
get
<=
await
resolve
bytes
print-method
bound?
loaded-libs
fnil
force
partial
pmap
if-let
comparator
pos?
char
take-while
extend-protocol
and
refer
underive
in-ns
iterator-seq
declare
ancestors
hash-combine
persistent!
locking
partition
map-indexed
contains?
update-proxy
interpose
chunk
aset-int
ifn?
definterface
load-file
delay
apply
swap!
defmulti
proxy
reify
subvec
byte-array
rest
keyword
ns-map
set-error-mode!
unquote
int
release-pending-sends
mod
bigdec
nfirst
nthnext
*agent*
aset-long
struct
array-map
unchecked-char
bigint
dec
println
aget
find-keyword
pr
drop
clojure-version
*print-dup*
gen-class
eval
aclone
char-name-string
pop
primitives-classnames
atom
defonce
bit-shift-right
delay?
num
realized?
disj
io!
*print-readably*
rational?
merge-with
take-nth
*fn-loader*
*print-meta*
double
lazy-seq
*in*
take-last
line-seq
take
unchecked-byte
when
areduce
set?
make-array
rand-nth
alias
use
juxt
alength
chunk-first
*source-path*
defprotocol
to-array
hash-map
bit-and-not
compare-and-set!
*assert*
type
repeatedly
trampoline
set-error-handler!
remove
find
coll?
drop-while
not-empty
flatten
println-str
list
chunk-next
every?
satisfies?
flush
sort
dissoc
not
binding
error-handler
get-method
agent
sorted-set
alter-var-root
merge
subseq
min
print-simple
bit-test
await-for
keep
disj!
meta
sh
*sh-env*
with-sh-env
with-sh-dir
*sh-dir*
*open-url-script*
browse-url
source
stack-element-str
set-break-handler!
find-doc
thread-stopper
demunge
apropos
dir
dir-fn
root-cause
pst
source-fn
doc
output-stream
copy
file
writer
as-relative-path
make-output-stream
make-parents
reader
default-streams-impl
delete-file
as-file
resource
input-stream
Coercions
make-input-stream
make-writer
as-url
make-reader
IOFactory
emit-array-impls
arr-impl
InternalReduce
internal-reduce
*remote-javadocs*
javadoc
*feeling-lucky*
add-remote-javadoc
*feeling-lucky-url*
*core-java-api*
add-local-javadoc
*local-javadocs*

View File

@ -1,8 +1,9 @@
#!/bin/ksh
#
# $OpenBSD: clojure,v 1.7 2011/09/16 12:47:50 jasper Exp $
# $OpenBSD: clojure,v 1.8 2011/11/30 19:40:28 jasper Exp $
JAVA_CMD=$(javaPathHelper -c clojure)
rlwrap ${JAVA_CMD} -classpath ${LOCALBASE}/share/java/classes/'*':${TRUEPREFIX}/clojure/clojure.jar:src:. \
rlwrap -f ${TRUEPREFIX}/clojure/clj_completions ${JAVA_CMD} -classpath \
${LOCALBASE}/share/java/classes/'*':${TRUEPREFIX}/clojure/clojure.jar:src:. \
clojure.main "$@"

View File

@ -1,6 +1,7 @@
@comment $OpenBSD: PLIST,v 1.2 2011/09/25 21:12:52 jasper Exp $
@comment $OpenBSD: PLIST,v 1.3 2011/11/30 19:40:29 jasper Exp $
bin/clojure
clojure/
clojure/clj_completions
clojure/clojure.jar
clojure/src/
clojure/src/assembly/