USING: definitions io.launcher kernel parser words sequences math
-math.parser namespaces editors make system ;
+math.parser namespaces editors make system combinators.short-circuit ;
IN: editors.emacs
+SYMBOL: emacsclient-path
+
+HOOK: default-emacsclient os ( -- path )
+
+M: object default-emacsclient ( -- path ) "emacsclient" ;
+
: emacsclient ( file line -- )
[
- \ emacsclient get "emacsclient" or ,
+ { [ \ emacsclient-path get ] [ default-emacsclient ] } 0|| ,
os windows? [ "--no-wait" , ] unless
- "+" swap number>string append ,
+ number>string "+" prepend ,
,
] { } make try-process ;
where first2 emacsclient ;
[ emacsclient ] edit-hook set-global
-
--- /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 ;
+IN: editors.emacs.windows
+
+M: windows default-emacsclient
+ "Emacs" t [ "emacsclient.exe" tail? ] find-in-program-files
+ "emacsclient.exe" or ;