]> gitweb.factorcode.org Git - factor.git/commitdiff
make emacsw32 work on windows out of the box
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 20 Feb 2009 18:15:26 +0000 (12:15 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 20 Feb 2009 18:15:26 +0000 (12:15 -0600)
basis/editors/emacs/emacs.factor
basis/editors/emacs/windows/authors.txt [new file with mode: 0755]
basis/editors/emacs/windows/windows.factor [new file with mode: 0755]

index 79387f9820dae12c0f97a442554350440358da80..fa78c1b429af7bb3659dddc15b3db7f100ce0194 100644 (file)
@@ -1,12 +1,18 @@
 USING: definitions io.launcher kernel parser words sequences math
-math.parser namespaces editors make system ;
+math.parser namespaces editors make system combinators.short-circuit ;
 IN: editors.emacs
 
+SYMBOL: emacsclient-path
+
+HOOK: default-emacsclient os ( -- path )
+
+M: object default-emacsclient ( -- path ) "emacsclient" ;
+
 : emacsclient ( file line -- )
     [
-        \ emacsclient get "emacsclient" or ,
+        { [ \ emacsclient-path get ] [ default-emacsclient ] } 0|| ,
         os windows? [ "--no-wait" , ] unless
-        "+" swap number>string append ,
+        number>string "+" prepend ,
         ,
     ] { } make try-process ;
 
@@ -14,4 +20,3 @@ IN: editors.emacs
     where first2 emacsclient ;
 
 [ emacsclient ] edit-hook set-global
-
diff --git a/basis/editors/emacs/windows/authors.txt b/basis/editors/emacs/windows/authors.txt
new file mode 100755 (executable)
index 0000000..7c1b2f2
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
diff --git a/basis/editors/emacs/windows/windows.factor b/basis/editors/emacs/windows/windows.factor
new file mode 100755 (executable)
index 0000000..d5c1e78
--- /dev/null
@@ -0,0 +1,9 @@
+! Copyright (C) 2009 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: editors.emacs io.directories.search.windows kernel sequences
+system ;
+IN: editors.emacs.windows
+
+M: windows default-emacsclient
+    "Emacs" t [ "emacsclient.exe" tail? ] find-in-program-files
+    "emacsclient.exe" or ;