emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 5a0250f7667: Jsonrpc: prevent while-no-input messing with jsonrpc


From: João Távora
Subject: master 5a0250f7667: Jsonrpc: prevent while-no-input messing with jsonrpc-request
Date: Tue, 28 Nov 2023 19:49:48 -0500 (EST)

branch: master
commit 5a0250f76676d8750f42bbca1af5c4553846949b
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Jsonrpc: prevent while-no-input messing with jsonrpc-request
    
    'jsonrpc-request' already has its "interrupt on user input" mechanism
    base on 'sit-for'.  If called from a situation that uses
    while-no-input to do basically the same, that mechanism may become
    confused, so it's important to prevent that interfence.
    
    This was confirmed to be a problem when using the Corfu completion
    front-end.
    
    See also
    
https://github.com/joaotavora/eglot/discussions/1127#discussioncomment-7277567
    
    Many thanks to JD Smith <jdtsmith@gmail.com> for helping me debug this
    and pointing in the right direction.
    
    * lisp/jsonrpc.el (Version): Bump to 1.0.18
    (jsonrpc-request): Bind throw-on-input to nil
---
 lisp/jsonrpc.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el
index 3cba9636e02..849a8d8eaee 100644
--- a/lisp/jsonrpc.el
+++ b/lisp/jsonrpc.el
@@ -4,7 +4,7 @@
 
 ;; Author: João Távora <joaotavora@gmail.com>
 ;; Keywords: processes, languages, extensions
-;; Version: 1.0.17
+;; Version: 1.0.18
 ;; Package-Requires: ((emacs "25.2"))
 
 ;; This is a GNU ELPA :core package.  Avoid functionality that is not
@@ -288,6 +288,7 @@ CANCEL-ON-INPUT-RETVAL.  Any future replies (normal or 
error) are
 ignored."
   (let* ((tag (cl-gensym "jsonrpc-request-catch-tag")) id-and-timer
          canceled
+         (throw-on-input nil)
          (retval
           (unwind-protect
               (catch tag



reply via email to

[Prev in Thread] Current Thread [Next in Thread]