2007-09-20 18:09:08 -04:00
|
|
|
USING: definitions io.launcher kernel parser words sequences math
|
2009-02-20 13:15:26 -05:00
|
|
|
math.parser namespaces editors make system combinators.short-circuit ;
|
2007-09-20 18:09:08 -04:00
|
|
|
IN: editors.emacs
|
|
|
|
|
2009-02-20 13:15:26 -05:00
|
|
|
SYMBOL: emacsclient-path
|
|
|
|
|
|
|
|
HOOK: default-emacsclient os ( -- path )
|
|
|
|
|
|
|
|
M: object default-emacsclient ( -- path ) "emacsclient" ;
|
|
|
|
|
2007-09-20 18:09:08 -04:00
|
|
|
: emacsclient ( file line -- )
|
|
|
|
[
|
2009-02-20 13:15:26 -05:00
|
|
|
{ [ \ emacsclient-path get ] [ default-emacsclient ] } 0|| ,
|
2008-11-16 20:15:09 -05:00
|
|
|
os windows? [ "--no-wait" , ] unless
|
2009-02-20 13:15:26 -05:00
|
|
|
number>string "+" prepend ,
|
2008-01-24 02:50:40 -05:00
|
|
|
,
|
2008-02-08 22:15:29 -05:00
|
|
|
] { } make try-process ;
|
2007-09-20 18:09:08 -04:00
|
|
|
|
|
|
|
: emacs ( word -- )
|
|
|
|
where first2 emacsclient ;
|
|
|
|
|
|
|
|
[ emacsclient ] edit-hook set-global
|