]> gitweb.factorcode.org Git - factor.git/blob - basis/editors/emacs/emacs.factor
make emacsw32 work on windows out of the box
[factor.git] / basis / editors / emacs / emacs.factor
1 USING: definitions io.launcher kernel parser words sequences math
2 math.parser namespaces editors make system combinators.short-circuit ;
3 IN: editors.emacs
4
5 SYMBOL: emacsclient-path
6
7 HOOK: default-emacsclient os ( -- path )
8
9 M: object default-emacsclient ( -- path ) "emacsclient" ;
10
11 : emacsclient ( file line -- )
12     [
13         { [ \ emacsclient-path get ] [ default-emacsclient ] } 0|| ,
14         os windows? [ "--no-wait" , ] unless
15         number>string "+" prepend ,
16         ,
17     ] { } make try-process ;
18
19 : emacs ( word -- )
20     where first2 emacsclient ;
21
22 [ emacsclient ] edit-hook set-global