-;;; 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))