From 2ff04469afd672c4e05512f301bbb91a650e3eb3 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Tue, 30 Jun 2015 17:36:52 -0700 Subject: [PATCH] editors.atom: make it work better with Mac OS X. --- basis/editors/atom/atom.factor | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/basis/editors/atom/atom.factor b/basis/editors/atom/atom.factor index 9be37c82b1..e5b9d152cc 100644 --- a/basis/editors/atom/atom.factor +++ b/basis/editors/atom/atom.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2014 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: editors io.standard-paths kernel make math.parser -namespaces sequences ; +USING: editors io.pathnames io.standard-paths kernel make +math.parser namespaces sequences system ; IN: editors.atom SINGLETON: atom-editor @@ -9,8 +9,20 @@ atom-editor editor-class set-global SYMBOL: atom-path +HOOK: find-atom os ( -- path ) + +M: object find-atom + "atom" ?find-in-path ; + +M: macosx find-atom + "com.github.Atom" find-native-bundle [ + "Contents/MacOS/Atom" append-path + ] [ + f + ] if* ; + M: atom-editor editor-command ( file line -- command ) [ - atom-path get [ "atom" ?find-in-path ] unless* , + atom-path get [ find-atom ] unless* , number>string ":" glue , ] { } make ;