[slime-cvs] CVS slime/contrib

mkoeppe mkoeppe at common-lisp.net
Tue Aug 28 08:25:54 UTC 2007


Update of /project/slime/cvsroot/slime/contrib
In directory clnet:/tmp/cvs-serv18540/contrib

Added Files:
	swank-presentations.lisp 
Log Message:
* swank-presentations.lisp (send-repl-results-to-emacs): 
Override core defun to mark up REPL results as presentations.

* swank-presentations.lisp: New file.
* slime-presentations.el: Load it.



--- /project/slime/cvsroot/slime/contrib/swank-presentations.lisp	2007/08/28 08:25:53	NONE
+++ /project/slime/cvsroot/slime/contrib/swank-presentations.lisp	2007/08/28 08:25:53	1.1
;;; swank-presentation-streams.lisp --- imitate LispM's presentations
;;;
;;; Authors: FIXME -- find all guilty parties
;;;
;;; License: This code has been placed in the Public Domain.  All warranties
;;;          are disclaimed.

(in-package :swank)

;;; More presentation-related code from swank.lisp can go here. --mkoeppe


(defun send-repl-results-to-emacs (values)
  ;; Override a function in swank.lisp, so that 
  ;; presentations are associated with every REPL result.
  (flet ((send (value)
           (let ((id (and *record-repl-results*
                          (save-presented-object value))))
	     (send-to-emacs `(:presentation-start ,id :repl-result))
	     (send-to-emacs `(:write-string ,(prin1-to-string value)
					    :repl-result))
	     (send-to-emacs `(:presentation-end ,id :repl-result))
	     (send-to-emacs `(:write-string ,(string #\Newline) 
					    :repl-result)))))
    (if (null values)
        (send-to-emacs `(:write-string "; No value" nil :repl-result))
        (mapc #'send values))))

(provide :swank-presentations)



More information about the slime-cvs mailing list