From 071704072cba094c7527052580a1073a5a87247d Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Mon, 1 Jun 2015 14:39:30 -0700 Subject: [PATCH] editors: bunch of cleanup. --- basis/editors/atom/atom.factor | 7 +++--- basis/editors/editpadlite/editpadlite.factor | 2 +- basis/editors/editpadpro/editpadpro.factor | 2 +- basis/editors/editplus/editplus.factor | 9 ++++--- basis/editors/emacs/emacs.factor | 24 ++++++++++--------- basis/editors/emacs/windows/authors.txt | 1 - basis/editors/emacs/windows/tags.txt | 1 - basis/editors/emacs/windows/windows.factor | 12 ---------- basis/editors/emeditor/emeditor.factor | 9 ++++--- basis/editors/etexteditor/etexteditor.factor | 10 ++++---- basis/editors/geany/geany.factor | 21 +++++++++------- basis/editors/geany/windows/authors.txt | 1 - basis/editors/geany/windows/windows.factor | 10 -------- basis/editors/gedit/gedit.factor | 8 +++---- basis/editors/gvim/gvim.factor | 17 ++++++++----- basis/editors/gvim/windows/authors.txt | 1 - basis/editors/gvim/windows/tags.txt | 1 - basis/editors/gvim/windows/windows.factor | 6 ----- basis/editors/jedit/jedit.factor | 15 +++++++----- basis/editors/macvim/macvim.factor | 5 ++-- basis/editors/notepad++/notepad++.factor | 20 ++++++++-------- basis/editors/notepad2/notepad2.factor | 2 +- .../{geany/windows => notepad2}/platforms.txt | 0 basis/editors/scite/scite.factor | 23 +++++++++++------- basis/editors/scite/windows/authors.txt | 1 - basis/editors/scite/windows/platforms.txt | 1 - basis/editors/scite/windows/windows.factor | 18 -------------- basis/editors/sublime/sublime.factor | 9 +++---- basis/editors/sublime/windows/platforms.txt | 1 - basis/editors/sublime/windows/windows.factor | 9 ------- basis/editors/ted-notepad/ted-notepad.factor | 8 +++---- basis/editors/textadept/textadept.factor | 17 +++++++------ basis/editors/textadept/windows/platforms.txt | 1 - .../editors/textadept/windows/windows.factor | 9 ------- basis/editors/textpad/textpad.factor | 10 ++++---- .../editors/textwrangler/textwrangler.factor | 12 +++++----- basis/editors/ultraedit/ultraedit.factor | 6 ++--- basis/editors/vim/vim.factor | 11 +++++---- .../visual-studio-code.factor | 5 ++-- .../visual-studio-code/windows/windows.factor | 2 +- 40 files changed, 140 insertions(+), 187 deletions(-) delete mode 100644 basis/editors/emacs/windows/authors.txt delete mode 100644 basis/editors/emacs/windows/tags.txt delete mode 100644 basis/editors/emacs/windows/windows.factor delete mode 100644 basis/editors/geany/windows/authors.txt delete mode 100644 basis/editors/geany/windows/windows.factor delete mode 100644 basis/editors/gvim/windows/authors.txt delete mode 100644 basis/editors/gvim/windows/tags.txt delete mode 100644 basis/editors/gvim/windows/windows.factor rename basis/editors/{geany/windows => notepad2}/platforms.txt (100%) delete mode 100644 basis/editors/scite/windows/authors.txt delete mode 100644 basis/editors/scite/windows/platforms.txt delete mode 100644 basis/editors/scite/windows/windows.factor delete mode 100644 basis/editors/sublime/windows/platforms.txt delete mode 100644 basis/editors/sublime/windows/windows.factor delete mode 100644 basis/editors/textadept/windows/platforms.txt delete mode 100644 basis/editors/textadept/windows/windows.factor diff --git a/basis/editors/atom/atom.factor b/basis/editors/atom/atom.factor index b6e81ed430..a20f60cf6d 100644 --- a/basis/editors/atom/atom.factor +++ b/basis/editors/atom/atom.factor @@ -1,16 +1,17 @@ ! Copyright (C) 2014 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: editors kernel make math.parser namespaces sequences ; +USING: editors io.standard-paths kernel make math.parser +namespaces sequences ; IN: editors.atom SINGLETON: atom-editor -atom-editor \ editor-class set-global +atom-editor editor-class set-global SYMBOL: atom-path M: atom-editor editor-command ( file line -- command ) [ - atom-path get "atom" or , + atom-path get [ "atom" ?find-in-path ] unless* , number>string ":" glue , ] { } make ; diff --git a/basis/editors/editpadlite/editpadlite.factor b/basis/editors/editpadlite/editpadlite.factor index de2a556f11..bf96457fd2 100644 --- a/basis/editors/editpadlite/editpadlite.factor +++ b/basis/editors/editpadlite/editpadlite.factor @@ -6,7 +6,7 @@ SINGLETON: editpadlite editpadlite editor-class set-global : editpadlite-path ( -- path ) - \ editpadlite-path get-global [ + \ editpadlite-path get [ { [ { "Just Great Software" "JGsoft" } "editpadlite.exe" find-in-applications ] [ { "Just Great Software" "JGsoft" } "editpadlite7.exe" find-in-applications ] diff --git a/basis/editors/editpadpro/editpadpro.factor b/basis/editors/editpadpro/editpadpro.factor index 0a618338c8..4fe8fed8a0 100644 --- a/basis/editors/editpadpro/editpadpro.factor +++ b/basis/editors/editpadpro/editpadpro.factor @@ -6,7 +6,7 @@ SINGLETON: editpadpro editpadpro editor-class set-global : editpadpro-path ( -- path ) - \ editpadpro-path get-global [ + \ editpadpro-path get [ { [ { "Just Great Software" "JGsoft" } "editpadpro.exe" find-in-applications ] [ { "Just Great Software" "JGsoft" } "editpadpro7.exe" find-in-applications ] diff --git a/basis/editors/editplus/editplus.factor b/basis/editors/editplus/editplus.factor index ac08432ffe..a3dc23887c 100644 --- a/basis/editors/editplus/editplus.factor +++ b/basis/editors/editplus/editplus.factor @@ -1,14 +1,13 @@ -USING: editors io.files io.launcher kernel math.parser -namespaces sequences windows.shell32 make -io.directories.search.windows ; +USING: editors io.standard-paths kernel make math.parser +namespaces ; IN: editors.editplus SINGLETON: editplus editplus editor-class set-global : editplus-path ( -- path ) - \ editplus-path get-global [ - "EditPlus 2" [ "editplus.exe" tail? ] find-in-program-files + \ editplus-path get [ + { "EditPlus 2" } "editplus.exe" find-in-applications [ "editplus.exe" ] unless* ] unless* ; diff --git a/basis/editors/emacs/emacs.factor b/basis/editors/emacs/emacs.factor index 683ddcad25..e790b90093 100644 --- a/basis/editors/emacs/emacs.factor +++ b/basis/editors/emacs/emacs.factor @@ -1,5 +1,5 @@ -USING: combinators.short-circuit editors kernel make -math.parser namespaces sequences system vocabs ; +USING: combinators.short-circuit editors io.standard-paths +kernel make math.parser namespaces sequences system ; IN: editors.emacs SINGLETON: emacsclient @@ -7,20 +7,22 @@ emacsclient editor-class set-global SYMBOL: emacsclient-path -HOOK: default-emacsclient os ( -- path ) +HOOK: find-emacsclient os ( -- path ) -M: object default-emacsclient ( -- path ) "emacsclient" ; +M: object find-emacsclient ( -- path ) + "emacsclient" ?find-in-path ; + +M: windows find-emacsclient + { + [ { "Emacs" } "emacsclientw.exe" find-in-applications ] + [ { "Emacs" } "emacsclient.exe" find-in-applications ] + [ "emacsclient.exe" ] + } 0|| ; M: emacsclient editor-command ( file line -- command ) [ - { - [ emacsclient-path get-global ] - [ default-emacsclient dup emacsclient-path set-global ] - } 0|| , + emacsclient-path get [ find-emacsclient ] unless* , "--no-wait" , number>string "+" prepend , , ] { } make ; - -os windows? [ "editors.emacs.windows" require ] when - diff --git a/basis/editors/emacs/windows/authors.txt b/basis/editors/emacs/windows/authors.txt deleted file mode 100644 index 1901f27a24..0000000000 --- a/basis/editors/emacs/windows/authors.txt +++ /dev/null @@ -1 +0,0 @@ -Slava Pestov diff --git a/basis/editors/emacs/windows/tags.txt b/basis/editors/emacs/windows/tags.txt deleted file mode 100644 index ebb74b4d5f..0000000000 --- a/basis/editors/emacs/windows/tags.txt +++ /dev/null @@ -1 +0,0 @@ -not loaded diff --git a/basis/editors/emacs/windows/windows.factor b/basis/editors/emacs/windows/windows.factor deleted file mode 100644 index 91d6e878e4..0000000000 --- a/basis/editors/emacs/windows/windows.factor +++ /dev/null @@ -1,12 +0,0 @@ -! Copyright (C) 2009 Doug Coleman. -! See http://factorcode.org/license.txt for BSD license. -USING: editors.emacs io.directories.search.windows kernel sequences -system combinators.short-circuit ; -IN: editors.emacs.windows - -M: windows default-emacsclient - { - [ "Emacs" [ "emacsclientw.exe" tail? ] find-in-program-files ] - [ "Emacs" [ "emacsclient.exe" tail? ] find-in-program-files ] - [ "emacsclient.exe" ] - } 0|| ; diff --git a/basis/editors/emeditor/emeditor.factor b/basis/editors/emeditor/emeditor.factor index 804c107473..9f6c3ec745 100644 --- a/basis/editors/emeditor/emeditor.factor +++ b/basis/editors/emeditor/emeditor.factor @@ -1,14 +1,13 @@ -USING: editors io.files io.launcher kernel math.parser -namespaces sequences windows.shell32 make -io.directories.search.windows ; +USING: editors io.standard-paths kernel make math.parser +namespaces ; IN: editors.emeditor SINGLETON: emeditor emeditor editor-class set-global : emeditor-path ( -- path ) - \ emeditor-path get-global [ - "EmEditor" [ "EmEditor.exe" tail? ] find-in-program-files + \ emeditor-path get [ + { "EmEditor" } "emeditor.exe" find-in-applications [ "EmEditor.exe" ] unless* ] unless* ; diff --git a/basis/editors/etexteditor/etexteditor.factor b/basis/editors/etexteditor/etexteditor.factor index fd2d60946e..5964f04a4a 100644 --- a/basis/editors/etexteditor/etexteditor.factor +++ b/basis/editors/etexteditor/etexteditor.factor @@ -1,16 +1,16 @@ ! Copyright (C) 2008 Kibleur Christophe. ! See http://factorcode.org/license.txt for BSD license. -USING: editors io.files io.launcher kernel math.parser make -namespaces sequences windows.shell32 io.directories.search.windows ; +USING: editors io.standard-paths kernel make math.parser +namespaces ; IN: editors.etexteditor SINGLETON: etexteditor etexteditor editor-class set-global : etexteditor-path ( -- str ) - \ etexteditor-path get-global [ - "e" [ "e.exe" tail? ] find-in-program-files - [ "e" ] unless* + \ etexteditor-path get [ + { "e" } "e.exe" find-in-applications + [ "e.exe" ] unless* ] unless* ; M: etexteditor editor-command ( file line -- command ) diff --git a/basis/editors/geany/geany.factor b/basis/editors/geany/geany.factor index f273812e58..cdaa47ec86 100644 --- a/basis/editors/geany/geany.factor +++ b/basis/editors/geany/geany.factor @@ -1,22 +1,27 @@ ! Copyright (C) 2013 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: editors fry kernel make math.parser namespaces system -vocabs ; +USING: combinators.short-circuit editors fry io.standard-paths +kernel make math.parser namespaces system vocabs ; IN: editors.geany SINGLETON: geany geany editor-class set-global -HOOK: geany-path os ( -- path ) +SYMBOL: geany-path -M: unix geany-path - \ geany-path get-global [ "geany" ] unless* ; +HOOK: find-geany-path os ( -- path ) + +M: unix find-geany-path "geany" ; + +M: windows find-geany-path + { + [ { "Geany" } "geany.exe" find-in-applications ] + [ "Geany.exe" ] + } 0|| ; M: geany editor-command '[ - geany-path , + geany-path get [ find-geany-path ] unless* , _ , "--line" , _ number>string , ] { } make ; - -os windows? [ "editors.geany.windows" require ] when \ No newline at end of file diff --git a/basis/editors/geany/windows/authors.txt b/basis/editors/geany/windows/authors.txt deleted file mode 100644 index 7c1b2f2279..0000000000 --- a/basis/editors/geany/windows/authors.txt +++ /dev/null @@ -1 +0,0 @@ -Doug Coleman diff --git a/basis/editors/geany/windows/windows.factor b/basis/editors/geany/windows/windows.factor deleted file mode 100644 index a4606d66be..0000000000 --- a/basis/editors/geany/windows/windows.factor +++ /dev/null @@ -1,10 +0,0 @@ -! Copyright (C) 2013 Doug Coleman. -! See http://factorcode.org/license.txt for BSD license. -USING: editors.geany io.directories.search.windows kernel -namespaces sequences system ; -IN: editors.geany.windows - -M: windows geany-path - \ geany-path get-global [ - "Geany" [ "Geany.exe" tail? ] find-in-program-files - ] unless* ; \ No newline at end of file diff --git a/basis/editors/gedit/gedit.factor b/basis/editors/gedit/gedit.factor index a1920fd389..f1d7b9314f 100644 --- a/basis/editors/gedit/gedit.factor +++ b/basis/editors/gedit/gedit.factor @@ -1,15 +1,15 @@ ! Copyright (C) 2008 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: editors io.launcher kernel make math.parser namespaces -sequences ; +USING: editors io.launcher io.standard-paths kernel make +math.parser namespaces sequences ; IN: editors.gedit SINGLETON: gedit gedit editor-class set-global : gedit-path ( -- path ) - \ gedit-path get-global [ - "gedit" + \ gedit-path get [ + "gedit" ?find-in-path ] unless* ; M: gedit editor-command ( file line -- command ) diff --git a/basis/editors/gvim/gvim.factor b/basis/editors/gvim/gvim.factor index 878c73dbdd..e776437ce1 100644 --- a/basis/editors/gvim/gvim.factor +++ b/basis/editors/gvim/gvim.factor @@ -1,5 +1,5 @@ -USING: editors.vim io.backend kernel namespaces system -vocabs editors ; +USING: editors.vim io.backend io.standard-paths kernel +namespaces system vocabs editors ; IN: editors.gvim ! This code builds on the code in editors.vim; see there for @@ -9,10 +9,15 @@ TUPLE: gvim < vim ; T{ gvim } editor-class set-global HOOK: find-gvim-path io-backend ( -- path ) + M: object find-gvim-path f ; -M: gvim find-vim-path find-gvim-path "gvim" or ; -M: gvim vim-ui? t ; -M: gvim editor-detached? t ; +M: windows find-gvim-path + { "vim" } "gvim.exe" find-in-applications ; -os windows? [ "editors.gvim.windows" require ] when +M: gvim find-vim-path + find-gvim-path [ "gvim" ?find-in-path ] unless* ; + +M: gvim vim-ui? t ; + +M: gvim editor-detached? t ; diff --git a/basis/editors/gvim/windows/authors.txt b/basis/editors/gvim/windows/authors.txt deleted file mode 100644 index 7c1b2f2279..0000000000 --- a/basis/editors/gvim/windows/authors.txt +++ /dev/null @@ -1 +0,0 @@ -Doug Coleman diff --git a/basis/editors/gvim/windows/tags.txt b/basis/editors/gvim/windows/tags.txt deleted file mode 100644 index ebb74b4d5f..0000000000 --- a/basis/editors/gvim/windows/tags.txt +++ /dev/null @@ -1 +0,0 @@ -not loaded diff --git a/basis/editors/gvim/windows/windows.factor b/basis/editors/gvim/windows/windows.factor deleted file mode 100644 index 380e6bb54f..0000000000 --- a/basis/editors/gvim/windows/windows.factor +++ /dev/null @@ -1,6 +0,0 @@ -USING: editors.gvim io.directories.search.windows sequences -system ; -IN: editors.gvim.windows - -M: windows find-gvim-path - "vim" [ "gvim.exe" tail? ] find-in-program-files ; diff --git a/basis/editors/jedit/jedit.factor b/basis/editors/jedit/jedit.factor index fa8f6f66e5..7a2b8114ed 100644 --- a/basis/editors/jedit/jedit.factor +++ b/basis/editors/jedit/jedit.factor @@ -12,18 +12,21 @@ ERROR: jedit-not-found ; HOOK: find-jedit-path os ( -- path ) -M: object find-jedit-path "jedit" ; +M: object find-jedit-path f ; M: macosx find-jedit-path - "org.gjt.sp.jedit" find-native-bundle - dup [ "Contents/MacOS/jedit" append-path ] when ; + "org.gjt.sp.jedit" find-native-bundle [ + "Contents/MacOS/jedit" append-path + ] [ + f + ] if* ; M: windows find-jedit-path { "jedit" } "jedit.exe" find-in-applications ; - + : jedit-path ( -- path ) - \ jedit-path get-global [ - find-jedit-path "jedit" or + \ jedit-path get [ + find-jedit-path [ "jedit" ?find-in-path ] unless* ] unless* ; M: jedit editor-command ( file line -- command/f ) diff --git a/basis/editors/macvim/macvim.factor b/basis/editors/macvim/macvim.factor index 62250ba6ce..6278833076 100644 --- a/basis/editors/macvim/macvim.factor +++ b/basis/editors/macvim/macvim.factor @@ -3,7 +3,7 @@ io.pathnames io.standard-paths kernel namespaces ; IN: editors.macvim TUPLE: macvim < vim ; -T{ macvim } \ editor-class set-global +T{ macvim } editor-class set-global : find-macvim-bundle-path ( -- path/f ) "org.vim.MacVim" find-native-bundle [ @@ -11,8 +11,9 @@ T{ macvim } \ editor-class set-global ] [ f ] if* ; - + M: macvim find-vim-path find-macvim-bundle-path ; M: macvim vim-ui? t ; + M: macvim editor-detached? t ; diff --git a/basis/editors/notepad++/notepad++.factor b/basis/editors/notepad++/notepad++.factor index 2f6393f967..9951943dc8 100644 --- a/basis/editors/notepad++/notepad++.factor +++ b/basis/editors/notepad++/notepad++.factor @@ -1,18 +1,18 @@ -USING: editors io.files io.launcher kernel math.parser -namespaces sequences io.directories.search.windows make ; -IN: editors.notepadpp +USING: editors io.standard-paths kernel make math.parser +namespaces sequences ; +IN: editors.notepad++ -SINGLETON: notepadpp -notepadpp editor-class set-global +SINGLETON: notepad++ +notepad++ editor-class set-global -: notepadpp-path ( -- path ) - \ notepadpp-path get-global [ - "notepad++" [ "notepad++.exe" tail? ] find-in-program-files +: notepad++-path ( -- path ) + \ notepad++-path get [ + { "notepad++" } "notepad++.exe" find-in-applications [ "notepad++.exe" ] unless* ] unless* ; -M: notepadpp editor-command ( file line -- command ) +M: notepad++ editor-command ( file line -- command ) [ - notepadpp-path , + notepad++-path , number>string "-n" prepend , , ] { } make ; diff --git a/basis/editors/notepad2/notepad2.factor b/basis/editors/notepad2/notepad2.factor index 744bab40e2..070273994c 100644 --- a/basis/editors/notepad2/notepad2.factor +++ b/basis/editors/notepad2/notepad2.factor @@ -6,7 +6,7 @@ SINGLETON: notepad2 notepad2 editor-class set-global : notepad2-path ( -- path ) - \ notepad2-path get-global [ + \ notepad2-path get [ windows-directory "system32\\notepad.exe" append-path [ "notepad.exe" ] unless* ] unless* ; diff --git a/basis/editors/geany/windows/platforms.txt b/basis/editors/notepad2/platforms.txt similarity index 100% rename from basis/editors/geany/windows/platforms.txt rename to basis/editors/notepad2/platforms.txt diff --git a/basis/editors/scite/scite.factor b/basis/editors/scite/scite.factor index 68df8aef55..49e1d74b07 100644 --- a/basis/editors/scite/scite.factor +++ b/basis/editors/scite/scite.factor @@ -1,25 +1,30 @@ ! Copyright (C) 2007 Clemens F. Hofreither. ! See http://factorcode.org/license.txt for BSD license. ! clemens.hofreither@gmx.net -USING: io.files io.launcher kernel namespaces -math math.parser editors sequences make system unicode.case -vocabs ; +USING: editors io.standard-paths kernel make math.parser +namespaces sequences system ; IN: editors.scite SINGLETON: scite scite editor-class set-global -HOOK: scite-path os ( -- path ) +SYMBOL: scite-path -M: unix scite-path ( -- path ) - \ scite-path get-global [ "scite" ] unless* ; +HOOK: find-scite-path os ( -- path ) + +M: unix find-scite-path "scite" ?find-in-path ; + +M: windows find-scite-path + { + "Scintilla Text Editor" + "SciTE Source Code Editor" + } "scite.exe" find-in-applications + [ "scite.exe" ] unless* ; M: scite editor-command ( file line -- cmd ) swap [ - scite-path , + scite-path get [ find-scite-path ] unless* , , number>string "-goto:" prepend , ] { } make ; - -os windows? [ "editors.scite.windows" require ] when diff --git a/basis/editors/scite/windows/authors.txt b/basis/editors/scite/windows/authors.txt deleted file mode 100644 index 7c1b2f2279..0000000000 --- a/basis/editors/scite/windows/authors.txt +++ /dev/null @@ -1 +0,0 @@ -Doug Coleman diff --git a/basis/editors/scite/windows/platforms.txt b/basis/editors/scite/windows/platforms.txt deleted file mode 100644 index 8e1a55995e..0000000000 --- a/basis/editors/scite/windows/platforms.txt +++ /dev/null @@ -1 +0,0 @@ -windows diff --git a/basis/editors/scite/windows/windows.factor b/basis/editors/scite/windows/windows.factor deleted file mode 100644 index 8bfcb4f626..0000000000 --- a/basis/editors/scite/windows/windows.factor +++ /dev/null @@ -1,18 +0,0 @@ -! Copyright (C) 2013 Doug Coleman. -! See http://factorcode.org/license.txt for BSD license. -USING: editors.scite io.directories.search.windows kernel -namespaces sequences system unicode.case ; -IN: editors.scite.windows - -M: windows scite-path ( -- path ) - \ scite-path get-global [ - "Scintilla Text Editor" - [ >lower "scite.exe" tail? ] find-in-program-files - - [ - "SciTE Source Code Editor" - [ >lower "scite.exe" tail? ] find-in-program-files - ] unless* - [ "scite.exe" ] unless* - ] unless* ; - diff --git a/basis/editors/sublime/sublime.factor b/basis/editors/sublime/sublime.factor index ff860bd194..83c2283f6f 100644 --- a/basis/editors/sublime/sublime.factor +++ b/basis/editors/sublime/sublime.factor @@ -9,7 +9,7 @@ sublime editor-class set-global HOOK: find-sublime-path os ( -- path ) -M: object find-sublime-path "sublime" ; +M: object find-sublime-path f ; M: macosx find-sublime-path { "com.sublimetext.3" "com.sublimetext.2" } [ find-native-bundle ] map-find drop [ @@ -18,11 +18,12 @@ M: macosx find-sublime-path f ] if* ; -ERROR: editor-not-found editor ; +M: windows find-sublime-path + { "Sublime Text 2" } "sublime_text.exe" find-in-applications ; : sublime-path ( -- path ) - \ sublime-path get-global [ - find-sublime-path [ "sublime" editor-not-found ] unless* + \ sublime-path get [ + find-sublime-path [ "subl" ?find-in-path ] unless* ] unless* ; M: sublime editor-command ( file line -- command ) diff --git a/basis/editors/sublime/windows/platforms.txt b/basis/editors/sublime/windows/platforms.txt deleted file mode 100644 index 8e1a55995e..0000000000 --- a/basis/editors/sublime/windows/platforms.txt +++ /dev/null @@ -1 +0,0 @@ -windows diff --git a/basis/editors/sublime/windows/windows.factor b/basis/editors/sublime/windows/windows.factor deleted file mode 100644 index abf2fc181e..0000000000 --- a/basis/editors/sublime/windows/windows.factor +++ /dev/null @@ -1,9 +0,0 @@ -! Copyright (C) 2013 Doug Coleman. -! See http://factorcode.org/license.txt for BSD license. -USING: editors.sublime io.directories.search.windows sequences -system ; -IN: editors.sublime.windows - -M: windows find-sublime-path - "Sublime Text 2" - [ "sublime_text.exe" tail? ] find-in-program-files ; diff --git a/basis/editors/ted-notepad/ted-notepad.factor b/basis/editors/ted-notepad/ted-notepad.factor index 7f8fb7e7c7..c463b0b294 100644 --- a/basis/editors/ted-notepad/ted-notepad.factor +++ b/basis/editors/ted-notepad/ted-notepad.factor @@ -1,13 +1,13 @@ -USING: editors io.files io.launcher kernel math.parser -namespaces sequences io.directories.search.windows make ; +USING: editors io.files io.launcher io.standard-paths kernel +math.parser namespaces sequences make ; IN: editors.ted-notepad SINGLETON: ted-notepad ted-notepad editor-class set-global : ted-notepad-path ( -- path ) - \ ted-notepad-path get-global [ - "TED Notepad" [ "TedNPad.exe" tail? ] find-in-program-files + \ ted-notepad-path get [ + { "TED Notepad" } "tednpad.exe" find-in-applications [ "TedNPad.exe" ] unless* ] unless* ; diff --git a/basis/editors/textadept/textadept.factor b/basis/editors/textadept/textadept.factor index d3c37ca313..0d37095573 100644 --- a/basis/editors/textadept/textadept.factor +++ b/basis/editors/textadept/textadept.factor @@ -9,8 +9,9 @@ ! ! For more information about Textadept, consult http://foicica.com/textadept/ -USING: editors io.launcher io.pathnames io.standard-paths -kernel make math math.parser namespaces sequences system vocabs ; +USING: combinators.short-circuit editors io.launcher +io.pathnames io.standard-paths kernel make math math.parser +namespaces sequences system vocabs ; IN: editors.textadept SINGLETON: textadept @@ -18,7 +19,7 @@ textadept editor-class set-global HOOK: find-textadept-path os ( -- path ) -M: object find-textadept-path "textadept" ; +M: object find-textadept-path f ; M: macosx find-textadept-path "com.textadept" find-native-bundle [ @@ -27,9 +28,13 @@ M: macosx find-textadept-path f ] if* ; +M: windows find-textadept-path + { "textadept_6.5.win32" } "textadept.exe" find-in-applications + [ "textadept.exe" ] unless* ; + : textadept-path ( -- path ) - \ textadept-path get-global [ - find-textadept-path "textadept" or + \ textadept-path get [ + find-textadept-path [ "textadept" ?find-in-path ] unless* ] unless* ; M: textadept editor-command ( file line -- command ) @@ -37,5 +42,3 @@ M: textadept editor-command ( file line -- command ) textadept-path , "-f" , , "-e" , 1 - number>string "goto_line(" ")" surround , ] { } make ; - -os windows? [ "editors.textadept.windows" require ] when diff --git a/basis/editors/textadept/windows/platforms.txt b/basis/editors/textadept/windows/platforms.txt deleted file mode 100644 index 8e1a55995e..0000000000 --- a/basis/editors/textadept/windows/platforms.txt +++ /dev/null @@ -1 +0,0 @@ -windows diff --git a/basis/editors/textadept/windows/windows.factor b/basis/editors/textadept/windows/windows.factor deleted file mode 100644 index 7dec4d87d8..0000000000 --- a/basis/editors/textadept/windows/windows.factor +++ /dev/null @@ -1,9 +0,0 @@ -! Copyright (C) 2013 Doug Coleman. -! See http://factorcode.org/license.txt for BSD license. -USING: editors.textadept io.directories.search.windows -sequences system ; -IN: editors.textadept.windows - -M: windows find-textadept-path - "textadept_6.5.win32" - [ "textadept.exe" tail? ] find-in-program-files ; diff --git a/basis/editors/textpad/textpad.factor b/basis/editors/textpad/textpad.factor index 6e809910e2..a2b0abb6e6 100644 --- a/basis/editors/textpad/textpad.factor +++ b/basis/editors/textpad/textpad.factor @@ -1,6 +1,5 @@ -USING: editors io.files io.launcher kernel math.parser -namespaces sequences make io.directories.search -io.directories.search.windows ; +USING: editors io.standard-paths kernel make math.parser +namespaces sequences ; IN: editors.textpad SINGLETON: textpad @@ -8,11 +7,12 @@ textpad editor-class set-global : textpad-path ( -- path ) \ textpad-path get-global [ - "TextPad 5" [ "TextPad.exe" tail? ] find-in-program-files + { "TextPad 5" } "textpad.exe" find-in-applications [ "TextPad.exe" ] unless* ] unless* ; M: textpad editor-command ( file line -- command ) [ - textpad-path , [ , ] [ number>string "(" ",0)" surround , ] bi* + textpad-path , + [ , ] [ number>string "(" ",0)" surround , ] bi* ] { } make ; diff --git a/basis/editors/textwrangler/textwrangler.factor b/basis/editors/textwrangler/textwrangler.factor index 1f645298d7..d95eae9f51 100644 --- a/basis/editors/textwrangler/textwrangler.factor +++ b/basis/editors/textwrangler/textwrangler.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008 Ben Schlingelhof. ! See http://factorcode.org/license.txt for BSD license. -USING: editors kernel make math.parser namespaces sequences -tools.which ; +USING: editors io.standard-paths kernel make math.parser +namespaces sequences ; IN: editors.textwrangler ! TextWrangler ships with a program called ``edit`` if you don't download @@ -14,12 +14,12 @@ IN: editors.textwrangler SINGLETON: textwrangler textwrangler editor-class set-global -M: textwrangler editor-command ( file line -- command ) - "edit" which [ - [ "edit +" % # " " % % ] "" make +M: textwrangler editor-command + "edit" find-in-path [ + [ , number>string "+" prepend , , ] { } make ] [ [ "open" , "-a" , "TextWrangler" , [ , ] [ "--args" , number>string "+" prepend , ] bi* ] { } make - ] if ; + ] if* ; diff --git a/basis/editors/ultraedit/ultraedit.factor b/basis/editors/ultraedit/ultraedit.factor index 42c1c42dfa..ec69b80472 100644 --- a/basis/editors/ultraedit/ultraedit.factor +++ b/basis/editors/ultraedit/ultraedit.factor @@ -1,5 +1,5 @@ -USING: editors io.files io.launcher kernel math.parser -namespaces sequences io.directories.search.windows make ; +USING: editors io.standard-paths kernel make math.parser +namespaces ; IN: editors.ultraedit SINGLETON: ultraedit @@ -7,7 +7,7 @@ ultraedit editor-class set-global : ultraedit-path ( -- path ) \ ultraedit-path get-global [ - "IDM Computer Solutions" [ "uedit32.exe" tail? ] find-in-program-files + { "IDM Computer Solutions" } "uedit32.exe" find-in-applications [ "uedit32.exe" ] unless* ] unless* ; diff --git a/basis/editors/vim/vim.factor b/basis/editors/vim/vim.factor index fb15a9387d..7aa46499d7 100644 --- a/basis/editors/vim/vim.factor +++ b/basis/editors/vim/vim.factor @@ -1,5 +1,5 @@ -USING: editors io.backend io.launcher kernel make math.parser -namespaces sequences strings system vocabs.loader math ; +USING: editors io.standard-paths kernel make math.parser +namespaces sequences strings ; IN: editors.vim TUPLE: vim ; @@ -8,12 +8,15 @@ T{ vim } editor-class set-global SYMBOL: vim-path HOOK: find-vim-path editor-class ( -- path ) + HOOK: vim-ui? editor-class ( -- ? ) + M: vim vim-ui? f ; -M: vim find-vim-path "vim" ; + +M: vim find-vim-path "vim" ?find-in-path ; : actual-vim-path ( -- path ) - \ vim-path get-global [ find-vim-path ] unless* ; + \ vim-path get [ find-vim-path ] unless* ; M: vim editor-command ( file line -- command ) [ diff --git a/basis/editors/visual-studio-code/visual-studio-code.factor b/basis/editors/visual-studio-code/visual-studio-code.factor index 5cac796904..22f460ea74 100644 --- a/basis/editors/visual-studio-code/visual-studio-code.factor +++ b/basis/editors/visual-studio-code/visual-studio-code.factor @@ -9,15 +9,14 @@ visual-studio-code editor-class set-global HOOK: find-visual-studio-code-path os ( -- path ) MEMO: visual-studio-code-path ( -- path ) - \ visual-studio-code-path get-global [ + \ visual-studio-code-path get [ find-visual-studio-code-path [ "code" ] unless* ] unless* ; M: visual-studio-code editor-command ( file line -- command ) [ - visual-studio-code-path , - swap , drop + visual-studio-code-path , drop , ] { } make ; os windows? [ "editors.visual-studio-code.windows" require ] when diff --git a/basis/editors/visual-studio-code/windows/windows.factor b/basis/editors/visual-studio-code/windows/windows.factor index 2467564d9f..703e47aae4 100644 --- a/basis/editors/visual-studio-code/windows/windows.factor +++ b/basis/editors/visual-studio-code/windows/windows.factor @@ -6,5 +6,5 @@ system ; IN: editors.visual-studio-code.windows M: windows find-visual-studio-code-path - get-appdata-directory 1array f + get-appdata-directory f [ file-name >lower "code.exe" = ] find-in-directories ;