]> gitweb.factorcode.org Git - factor.git/blob - basis/editors/emacs/emacs.factor
f1b12b6211629af9cb57a87c415d7785ebdd892b
[factor.git] / basis / editors / emacs / emacs.factor
1 USING: combinators.short-circuit editors io.standard-paths
2 kernel make math.parser namespaces sequences system ;
3 IN: editors.emacs
4
5 SINGLETON: emacs
6
7 editor-class [ emacs ] initialize
8
9 SYMBOL: emacsclient-path
10 SYMBOL: emacsclient-args
11
12 HOOK: find-emacsclient os ( -- path )
13
14 M: object find-emacsclient
15     "emacsclient" ?find-in-path ;
16
17 M: windows find-emacsclient
18     {
19         [ { "Emacs" } "emacsclientw.exe" find-in-applications ]
20         [ { "Emacs" } "emacsclient.exe" find-in-applications ]
21         [ "emacsclient.exe" ]
22     } 0|| ;
23
24 M: emacs editor-command
25     [
26         emacsclient-path get [ find-emacsclient ] unless* ,
27         emacsclient-args get [ { "-a=emacs" "--no-wait" } ] unless* %
28         number>string "+" prepend ,
29         ,
30     ] { } make ;