]> git.jsancho.org Git - gacela.git/blobdiff - emacs/emacs_conf.lisp
Adjustments for running games from emacs or shell.
[gacela.git] / emacs / emacs_conf.lisp
index cee867d0c2f10aac3f944315d354371ed05f0d5a..db027e5c720c705676df998140b161d56be43d97 100644 (file)
@@ -1,24 +1,28 @@
-;;; Gacela configuration
+;;; Guile configuration
 
-(defun launch-gacela ()
+(defun launch-guile ()
   (interactive)
-  (start-process "gacela" "gacela" "/home/jsancho/proyectos/gacela/trunk/src/gacela" "--dev"))
+  (let ((process-connection-type nil))
+    (start-process "guile" "guile" "/usr/bin/guile")))
 
-(defun send-to-gacela ()
+(defun send-to-guile ()
   (interactive)
-  (cond ((not (get-process "gacela"))
-        (launch-gacela)))
-  (process-send-string "gacela" "(begin ")
-  (cond ((use-region-p)
-        (process-send-region "gacela" (region-beginning) (region-end)))
-       (t
-        (process-send-string "gacela" "(run-game) (hide-all-mobs)")
-        (process-send-region "gacela" (point-min-marker) (point-max-marker))))
-  (process-send-string "gacela" "\n)\n"))
+  (cond ((not (get-process "guile"))
+        (launch-guile)))
 
-(define-key global-map [(ctrl x) (ctrl g)] 'send-to-gacela)
+  (process-send-string
+   "guile"
+   (replace-regexp-in-string
+    "\t" " "
+    (cond ((use-region-p)
+          (buffer-substring-no-properties (region-beginning) (region-end)))
+         (t
+          (buffer-substring-no-properties (point-min-marker) (point-max-marker)))))))
 
-(define-key-after global-map [menu-bar tools gacela] (cons "Gacela" (make-sparse-keymap "hoot hoot")) 'games)
-(define-key global-map [menu-bar tools gacela send] '("Send to Gacela" . send-to-gacela))
-(define-key global-map [menu-bar tools gacela launch] '("Launch Gacela" . launch-gacela))
+
+(define-key global-map [(ctrl x) (ctrl g)] 'send-to-guile)
+
+(define-key-after global-map [menu-bar tools guile] (cons "Guile" (make-sparse-keymap "hoot hoot")) 'games)
+(define-key global-map [menu-bar tools guile send] '("Send to Guile" . send-to-guile))
+(define-key global-map [menu-bar tools guile launch] '("Launch Guile" . launch-guile))