]> gitweb.factorcode.org Git - factor.git/blob - basis/editors/jedit/jedit.factor
basis: ERROR: changes.
[factor.git] / basis / editors / jedit / jedit.factor
1 ! Copyright (C) 2004, 2010 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: combinators.short-circuit editors io.pathnames
4 io.standard-paths kernel make math.parser namespaces sequences
5 system ;
6 IN: editors.jedit
7
8 SINGLETON: jedit
9 jedit editor-class set-global
10
11 HOOK: find-jedit-path os ( -- path )
12
13 M: object find-jedit-path f ;
14
15 M: macosx find-jedit-path
16     "org.gjt.sp.jedit" find-native-bundle [
17         "Contents/MacOS/jedit" append-path
18     ] [
19         f
20     ] if* ;
21
22 M: windows find-jedit-path
23     { "jedit" } "jedit.exe" find-in-applications ;
24
25 : jedit-path ( -- path )
26     \ jedit-path get [
27         find-jedit-path [ "jedit" ?find-in-path ] unless*
28     ] unless* ;
29
30 M: jedit editor-command ( file line -- command/f )
31     [
32         find-jedit-path ,
33         "-reuseview" ,
34         [ , ] [ number>string "+line:" prepend , ] bi*
35     ] { } make ;