! 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 ;
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 ]
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 ]
-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* ;
-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
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
-
+++ /dev/null
-Slava Pestov
+++ /dev/null
-not loaded
+++ /dev/null
-! 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|| ;
-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* ;
! 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 )
! 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
+++ /dev/null
-Doug Coleman
+++ /dev/null
-! 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
! 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 )
-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
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: windows find-gvim-path
+ { "vim" } "gvim.exe" find-in-applications ;
+
+M: gvim find-vim-path
+ find-gvim-path [ "gvim" ?find-in-path ] unless* ;
+
M: gvim vim-ui? t ;
-M: gvim editor-detached? t ;
-os windows? [ "editors.gvim.windows" require ] when
+M: gvim editor-detached? t ;
+++ /dev/null
-Doug Coleman
+++ /dev/null
-not loaded
+++ /dev/null
-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 ;
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 )
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 [
] [
f
] if* ;
-
+
M: macvim find-vim-path find-macvim-bundle-path ;
M: macvim vim-ui? t ;
+
M: macvim editor-detached? t ;
-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 ;
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* ;
! 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
+++ /dev/null
-Doug Coleman
+++ /dev/null
-! 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* ;
-
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 [
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 )
+++ /dev/null
-! 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 ;
-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* ;
!
! 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
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 [
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 )
textadept-path , "-f" , , "-e" ,
1 - number>string "goto_line(" ")" surround ,
] { } make ;
-
-os windows? [ "editors.textadept.windows" require ] when
+++ /dev/null
-! 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 ;
-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
: 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 ;
! 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
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* ;
-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
: 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* ;
-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 ;
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 )
[
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
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 ;