X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=emacs%2Femacs_conf.lisp;h=db027e5c720c705676df998140b161d56be43d97;hb=1e23ab1af645ad52cdbb0fde99d01fa21226f1cc;hp=cee867d0c2f10aac3f944315d354371ed05f0d5a;hpb=d136d708eebea09de72a9c946302aaef94a163e4;p=gacela.git diff --git a/emacs/emacs_conf.lisp b/emacs/emacs_conf.lisp index cee867d..db027e5 100644 --- a/emacs/emacs_conf.lisp +++ b/emacs/emacs_conf.lisp @@ -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))