]> gitweb.factorcode.org Git - factor.git/blob - basis/editors/kate/kate.factor
editors.kate: adding Kate editor integration
[factor.git] / basis / editors / kate / kate.factor
1 USING: editors io.pathnames io.standard-paths kernel make
2 math.parser namespaces sequences system ;
3
4 IN: editors.kate
5
6 SINGLETON: kate
7
8 editor-class [ kate ] initialize
9
10 HOOK: find-kate-path os ( -- path )
11
12 M: object find-kate-path f ;
13
14 M: windows find-kate-path
15     { "Kate" } "kate.exe" find-in-applications
16     [ "kate.exe" ] unless* ;
17
18 M: macosx find-kate-path
19     "org.kde.Kate" find-native-bundle [
20         "Contents/MacOS/kate" append-path
21     ] [
22         f
23     ] if* ;
24
25 : kate-path ( -- path )
26     \ kate-path get [
27         find-kate-path [ "kate" ?find-in-path ] unless*
28     ] unless* ;
29
30 M: kate editor-command
31     [ kate-path , drop , ] { } make ;