-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathswank-buffer-streams.lisp
38 lines (31 loc) · 1.15 KB
/
swank-buffer-streams.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
;;; swank-buffer-streams.lisp --- Streams that output to a buffer
;;;
;;; Authors: Ed Langley <[email protected]>
;;;
;;; License: This code has been placed in the Public Domain. All warranties
;;; are disclaimed.
(in-package :swank)
(defpackage :swank-buffer-streams
(:use :cl)
(:import-from :swank
defslimefun
add-hook
encode-message
send-event
find-thread
dcase
current-socket-io
send-to-emacs
current-thread-id
wait-for-event
*emacs-connection*
*event-hook*)
(:export make-buffer-output-stream))
(in-package :swank-buffer-streams)
(defun get-temporary-identifier ()
(intern (symbol-name (gensym "STREAM-BUFFER-")) :keyword))
(defun make-buffer-output-stream (&optional (target-identifier (get-temporary-identifier)))
(swank:ed-rpc '#:slime-make-buffer-stream-target (current-thread-id) target-identifier)
(values (swank:make-output-stream-for-target *emacs-connection* target-identifier)
target-identifier))
(provide :swank-buffer-streams)