]> gitweb.factorcode.org Git - factor.git/blob - basis/editors/emacs/emacs.factor
Merge commit 'origin/master' into emacs
[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 fry threads ;
4 IN: editors.emacs
5
6 SYMBOL: emacsclient-path
7
8 HOOK: default-emacsclient os ( -- path )
9
10 M: object default-emacsclient ( -- path ) "emacsclient" ;
11
12 : emacsclient ( file line -- )
13     [
14         { [ \ emacsclient-path get ] [ default-emacsclient ] } 0|| ,
15         "--no-wait" ,
16         number>string "+" prepend ,
17         ,
18     ] { } make
19     os windows? [ run-detached drop ] [ try-process ] if ;
20
21 : emacs ( word -- )
22     where first2 emacsclient ;
23
24 [ emacsclient ] edit-hook set-global