]> gitweb.factorcode.org Git - factor.git/blob - basis/editors/emacs/emacs.factor
basis: removing unnecessary method stack effects.
[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: emacsclient
6 emacsclient editor-class set-global
7
8 SYMBOL: emacsclient-path
9 SYMBOL: emacsclient-args
10
11 HOOK: find-emacsclient os ( -- path )
12
13 M: object find-emacsclient
14     "emacsclient" ?find-in-path ;
15
16 M: windows find-emacsclient
17     {
18         [ { "Emacs" } "emacsclientw.exe" find-in-applications ]
19         [ { "Emacs" } "emacsclient.exe" find-in-applications ]
20         [ "emacsclient.exe" ]
21     } 0|| ;
22
23 M: emacsclient editor-command
24     [
25         emacsclient-path get [ find-emacsclient ] unless* ,
26         emacsclient-args get [ { "-a=emacs" "--no-wait" } ] unless* %
27         number>string "+" prepend ,
28         ,
29     ] { } make ;