factor/basis/editors/emacs/emacs.factor

27 lines
647 B
Factor
Raw Normal View History

2011-11-03 15:02:06 -04:00
USING: combinators.short-circuit editors kernel make
math.parser namespaces sequences system vocabs ;
2007-09-20 18:09:08 -04:00
IN: editors.emacs
SINGLETON: emacsclient
emacsclient editor-class set-global
SYMBOL: emacsclient-path
HOOK: default-emacsclient os ( -- path )
M: object default-emacsclient ( -- path ) "emacsclient" ;
M: emacsclient editor-command ( file line -- command )
2007-09-20 18:09:08 -04:00
[
{
[ emacsclient-path get-global ]
[ default-emacsclient dup emacsclient-path set-global ]
} 0|| ,
"--no-wait" ,
number>string "+" prepend ,
2008-01-24 02:50:40 -05:00
,
2011-11-03 15:02:06 -04:00
] { } make ;
2007-09-20 18:09:08 -04:00
os windows? [ "editors.emacs.windows" require ] when
2011-11-03 15:02:06 -04:00