source: trunk/source/cocoa-ide/swank-ccl-ide.el @ 12136

Last change on this file since 12136 was 12136, checked in by mikel, 11 years ago

added elisp and ccl sides of a simple protocol with which SLIME can request CCL to load and start swank. Not quite working yet; still need to add response-handling in the elisp side, and the code that checks for swank and reports the results n the CCL side. The IDE build loads the code but does not yet turn on the swank listener.

File size: 1.7 KB
Line 
1;;;; ***********************************************************************
2;;;; FILE IDENTIFICATION
3;;;;
4;;;; Name:          swank-ccl-ide.el
5;;;; Project:       CCL IDE
6;;;; Purpose:       swank extensions for use with the CCL IDE
7;;;;
8;;;; ***********************************************************************
9
10;;; ABOUT
11;;; ------------------------------------------------------------------------
12
13;;; this file implements an extension to SLIME that talks to CCL's
14;;; Cocoa app
15;;; it provides utilities that:
16;;; 1. tell CCL to find and load the swank-loader currently in use by
17;;;    the running Emacs
18;;; 2.  start a swank server on a specified port.
19;;; 3. tell SLIME to connect to swank on the specified port
20
21(defun swank-loader-path () (concat slime-path "swank-laoder.lisp"))
22
23(defvar *ccl-swank-listener-host* "127.0.0.1")
24(defvar *ccl-swank-listener-port* 4884)
25(defvar *ccl-swank-listener-proc* nil)
26
27
28;;; TODO: make this filter function start up a connection to
29;;;       the CCL swank server if it reads a success message,
30;;;       or display an informative error if it reads a
31;;;       failure message
32(defun slime-ccl-swank-filter (process string)
33  (message (concat "CCL swank listener: " string)))
34
35(defun request-ccl-load-swank (&optional 
36                               (host *ccl-swank-listener-host*)
37                               (port *ccl-swank-listener-port*))
38  (let ((ping "[emacs-ccl-swank-request]" (swank-loader-path) "\n")
39        (ccl-proc (open-network-stream "SLIME CCL Swank" nil host port)))
40    (setq *ccl-swank-listener-proc* ccl-proc)
41    (set-process-filter ccl-proc 'slime-ccl-swank-filter)
42    ;; send ping
43    (process-send-string ccl-proc ping)
44    ccl-proc))
Note: See TracBrowser for help on using the repository browser.