File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,9 @@ but will NOT work on ClojureScript. This option assumes 'monroe-detail-stacktrac
8787(defvar monroe-requests-counter 0
8888 " Serial number for message." )
8989
90+ (defvar monroe-custom-handlers (make-hash-table :test 'equal )
91+ " Map of handlers for custom ops." )
92+
9093(defvar monroe-repl-buffer " *monroe*"
9194 " Name of nREPL buffer." )
9295
@@ -271,12 +274,13 @@ history purposes."
271274 (kill-buffer (process-buffer process))
272275 (monroe-disconnect))
273276
274- (defun monroe-dispatch (response )
275- " Find response id and call associated callback."
276- (monroe-dbind-response response (id)
277- (let ((callback (gethash id monroe-requests)))
278- (when callback
279- (funcall callback response)))))
277+ (defun monroe-dispatch (msg )
278+ " Find associated callback for a message by id or by op."
279+ (monroe-dbind-response msg (id op)
280+ (let ((callback (or (gethash id monroe-requests)
281+ (gethash op monroe-custom-handlers))))
282+ (when callback
283+ (funcall callback msg)))))
280284
281285(defun monroe-net-decode ()
282286 " Decode the data in the current buffer and remove the processed data from the
You can’t perform that action at this time.
0 commit comments