factor/basis/editors/etexteditor/etexteditor.factor

22 lines
626 B
Factor
Raw Normal View History

2008-11-13 16:47:39 -05:00
! Copyright (C) 2008 Kibleur Christophe.
! See http://factorcode.org/license.txt for BSD license.
2008-12-15 22:45:18 -05:00
USING: editors io.files io.launcher kernel math.parser make
namespaces sequences windows.shell32 io.directories.search.windows ;
2008-11-13 16:47:39 -05:00
IN: editors.etexteditor
SINGLETON: etexteditor
etexteditor editor-class set-global
2008-11-13 16:47:39 -05:00
: etexteditor-path ( -- str )
\ etexteditor-path get-global [
"e" [ "e.exe" tail? ] find-in-program-files
[ "e" ] unless*
2008-11-13 16:47:39 -05:00
] unless* ;
M: etexteditor editor-command ( file line -- command )
2008-11-13 16:47:39 -05:00
[
2008-11-13 17:10:43 -05:00
etexteditor-path ,
2008-11-13 17:07:01 -05:00
[ , ] [ "--line" , number>string , ] bi*
] { } make ;
2008-11-13 16:47:39 -05:00