]> gitweb.factorcode.org Git - factor.git/blob - basis/editors/aquamacs/aquamacs.factor
editors.aquamacs: use find-native-bundle.
[factor.git] / basis / editors / aquamacs / aquamacs.factor
1 ! File: aquamacs.factor
2 ! Version: 0.1
3 ! DRI: Dave Carlton
4 ! Description: Another fine Factor file!
5 ! Copyright (C) 2017 Dave Carlton.
6 ! See http://factorcode.org/license.txt for BSD license.
7 USING: editors io.pathnames io.standard-paths kernel make
8 math.parser namespaces sequences system ;
9 IN: editors.aquamacs
10
11 SINGLETON: aquamacs
12
13 editor-class [ aquamacs ] initialize
14
15 HOOK: find-aquamacs-path os ( -- path )
16
17 M: object find-aquamacs-path f ;
18
19 M: macosx find-aquamacs-path
20     "org.gnu.Aquamacs" find-native-bundle [
21         "Contents/MacOS/bin/aquamacs" append-path
22     ] [
23         f
24     ] if* ;
25
26 : aquamacs-path ( -- path )
27     \ aquamacs-path get [
28         find-aquamacs-path [ "aquamacs" ?find-in-path ] unless*
29     ] unless* ;
30
31 M: aquamacs editor-command ( file line -- command )
32     [ aquamacs-path , drop , ] { } make ;