/[slime]/slime/swank.lisp
ViewVC logotype

Diff of /slime/swank.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.86 by heller, Fri Jan 2 18:20:53 2004 UTC revision 1.87 by heller, Tue Jan 6 13:42:22 2004 UTC
# Line 145  Redirection is done while Lisp is proces Line 145  Redirection is done while Lisp is proces
145          (apply fn args))          (apply fn args))
146        (apply fn args)))        (apply fn args)))
147    
148    (defvar *log-events* nil)
149    
150    (defun log-event (format-string &rest args)
151      "Write a message to *terminal-io* when *log-events* is non-nil.
152    Useful for low level debugging."
153      (when *log-events*
154        (apply #'format *terminal-io* format-string args)))
155    
156  (defun read-from-emacs ()  (defun read-from-emacs ()
157    "Read and process a request from Emacs."    "Read and process a request from Emacs."
158    (let ((form (read-next-form)))    (let ((form (read-next-form)))
159        (log-event "READ: ~S~%" form)
160      (call-with-slime-streams      (call-with-slime-streams
161       *slime-input* *slime-output* *slime-io*       *slime-input* *slime-output* *slime-io*
162       #'funcall form)))       #'funcall form)))
# Line 194  back to the main request handling loop." Line 203  back to the main request handling loop."
203    "Send `object' to Emacs."    "Send `object' to Emacs."
204    (let* ((string (prin1-to-string-for-emacs object))    (let* ((string (prin1-to-string-for-emacs object))
205           (length (1+ (length string))))           (length (1+ (length string))))
206        (log-event "SEND: ~A~%" string)
207      (with-I/O-lock      (with-I/O-lock
208        (without-interrupts*        (without-interrupts*
209         (lambda ()         (lambda ()
# Line 425  has changed, ignore the request." Line 435  has changed, ignore the request."
435      (swank::send-to-emacs      (swank::send-to-emacs
436       `(:%apply ,(string-downcase (string fn)) ,args))))       `(:%apply ,(string-downcase (string fn)) ,args))))
437    
438  (defslimefun eval-string (string buffer-package)  (defslimefun eval-string (string buffer-package id)
439    (let ((*processing-rpc* t)    (let ((*processing-rpc* t)
440          (*debugger-hook* #'swank-debugger-hook))          (*debugger-hook* #'swank-debugger-hook))
441      (let (ok result)      (let (ok result)
# Line 437  has changed, ignore the request." Line 447  has changed, ignore the request."
447               (setq ok t))               (setq ok t))
448          (sync-state-to-emacs)          (sync-state-to-emacs)
449          (force-output *slime-io*)          (force-output *slime-io*)
450          (send-to-emacs (if ok `(:ok ,result) '(:aborted))))))          (send-to-emacs `(:return ,(if ok `(:ok ,result) '(:abort)) ,id)))))
451    (when *debugger-hook-passback*    (when *debugger-hook-passback*
452      (setq *debugger-hook* *debugger-hook-passback*)      (setq *debugger-hook* *debugger-hook-passback*)
453      (setq *debugger-hook-passback* nil)))      (setq *debugger-hook-passback* nil)))

Legend:
Removed from v.1.86  
changed lines
  Added in v.1.87

  ViewVC Help
Powered by ViewVC 1.1.5