]> gitweb.factorcode.org Git - factor.git/blob - basis/editors/emacs/emacs.factor
Update emacs for editors protocol.
[factor.git] / basis / editors / emacs / emacs.factor
1 USING: combinators.short-circuit editors kernel make
2 math.parser namespaces sequences system vocabs ;
3 IN: editors.emacs
4
5 SINGLETON: emacsclient
6 emacsclient editor-class set-global
7
8 SYMBOL: emacsclient-path
9
10 HOOK: default-emacsclient os ( -- path )
11
12 M: object default-emacsclient ( -- path ) "emacsclient" ;
13
14 M: emacsclient editor-command ( file line -- command )
15     [
16         {
17             [ emacsclient-path get-global ]
18             [ default-emacsclient dup emacsclient-path set-global ]
19         } 0|| ,
20         "--no-wait" ,
21         number>string "+" prepend ,
22         ,
23     ] { } make ;
24
25 os windows? [ "editors.emacs.windows" require ] when
26