@@ -221,9 +221,9 @@ To be used for tooling calls (i.e. completion, eldoc, etc)")
221
221
(defvar-local nrepl-request-counter 0
222
222
" Continuation serial number counter." )
223
223
224
- (defvar-local nrepl-pending-requests ( make-hash-table :test 'equal ) )
224
+ (defvar-local nrepl-pending-requests nil )
225
225
226
- (defvar-local nrepl-completed-requests ( make-hash-table :test 'equal ) )
226
+ (defvar-local nrepl-completed-requests nil )
227
227
228
228
(defvar-local nrepl-buffer-ns " user"
229
229
" Current Clojure namespace of this buffer." )
@@ -533,7 +533,9 @@ within Emacs. Return the newly created client connection process."
533
533
; ; fixme: repl and connection buffers are the same thing
534
534
nrepl-connection-buffer client-buf
535
535
nrepl-repl-buffer (when replp client-buf)
536
- nrepl-on-connection-buffer proc-buffer-name))
536
+ nrepl-on-connection-buffer proc-buffer-name
537
+ nrepl-pending-requests (make-hash-table :test 'equal )
538
+ nrepl-completed-requests (make-hash-table :test 'equal )))
537
539
538
540
(nrepl-make-connection-default client-buf)
539
541
@@ -549,8 +551,9 @@ within Emacs. Return the newly created client connection process."
549
551
" Return a handler to setup CONN-BUFFER as a connection buffer.
550
552
If REPLP is non-nil, also initialize it as a REPL buffer."
551
553
(lambda (response )
552
- (nrepl-dbind-response response (ops versions)
554
+ (nrepl-dbind-response response (id ops versions)
553
555
(with-current-buffer conn-buffer
556
+ (remhash id nrepl-pending-requests)
554
557
(setq nrepl-ops ops)
555
558
(setq nrepl-versions versions)))
556
559
(when replp
@@ -562,9 +565,9 @@ If REPLP is non-nil, also initialize it as a REPL buffer."
562
565
" Create a new session handler for PROCESS."
563
566
(lambda (response )
564
567
(nrepl-dbind-response response (id new-session err)
565
- (remhash id nrepl-pending-requests)
566
568
(if new-session
567
569
(with-current-buffer (process-buffer process)
570
+ (remhash id nrepl-pending-requests)
568
571
(setq nrepl-session new-session))
569
572
(error " Could not create new session (%s ) " err))
570
573
(run-hooks 'nrepl-connected-hook ))))
@@ -696,9 +699,9 @@ REQUEST is a pair list of the form (\"op\" \"operation\" \"par1-name\"
696
699
(request (append (list 'dict " id" request-id) request))
697
700
(message (nrepl-bencode request)))
698
701
(nrepl-log-message request)
699
- (puthash request-id callback nrepl-pending-requests )
700
- ( process-send-string ( nrepl-current-connection-buffer )
701
- message)))
702
+ (with-current-buffer ( nrepl-current-connection-buffer )
703
+ ( puthash request-id callback nrepl-pending-requests )
704
+ ( process-send-string nil message) )))
702
705
703
706
(defun nrepl-request:clone (callback )
704
707
" Sent a :clone request to create a new client session.
0 commit comments