1 ! Copyright (C) 2004, 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: arrays definitions io kernel math
4 namespaces parser prettyprint sequences strings words
5 editors io.files io.sockets io.streams.byte-array io.binary
6 math.parser io.encodings.ascii io.encodings.binary
7 io.encodings.utf8 io.files.private io.pathnames ;
10 : jedit-server-info ( -- port auth )
11 home ".jedit/server" append-path ascii [
17 : make-jedit-request ( files -- code )
19 "EditServer.handleClient(false,false,false," write
22 "new String[] {" write
23 [ pprint "," write ] each
27 : send-jedit-request ( request -- )
28 jedit-server-info "localhost" rot <inet> binary [
30 dup length 2 >be write
34 : jedit-location ( file line -- )
35 number>string "+line:" prepend 2array
36 make-jedit-request send-jedit-request ;
38 : jedit-file ( file -- )
39 1array make-jedit-request send-jedit-request ;
41 [ jedit-location ] edit-hook set-global