Merge from origin/emacs-29
authorEli Zaretskii <eliz@gnu.org>
Sat, 20 Jan 2024 11:25:59 +0000 (06:25 -0500)
committerEli Zaretskii <eliz@gnu.org>
Sat, 20 Jan 2024 11:25:59 +0000 (06:25 -0500)
5bb5590dec9 Fix blunder in labeled_narrow_to_region
78ddb32fadb Fix documentation of icon-elements
725a3f32f8b ; Fix typos in symbol names
6653ee66ca5 Improve two docstrings in ox-latex
7d869a04029 Doc fix in auth-source-read-char-choice
f149de223bf Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/...
1f97a878795 Fix info-xref-tests
51f391998b1 Add @kindex in manuals for existing keybindings on 'C-x x...

16 files changed:
1  2 
admin/cus-test.el
doc/emacs/buffers.texi
doc/emacs/files.texi
doc/emacs/windows.texi
lisp/abbrev.el
lisp/auth-source.el
lisp/calendar/todo-mode.el
lisp/jsonrpc.el
lisp/org/org-element.el
lisp/org/org-macs.el
lisp/org/ox-latex.el
lisp/progmodes/eglot.el
lisp/term.el
lisp/treesit.el
lisp/window.el
src/editfns.c

Simple merge
Simple merge
Simple merge
Simple merge
diff --cc lisp/abbrev.el
Simple merge
Simple merge
Simple merge
diff --cc lisp/jsonrpc.el
index 7ff57daeb7d4a23b5bd2cb57b130fa1b7d57120e,f2060d3faa1a79cd477fe2bef3e8c07a5f701e7e..0ecde0a5425611bf7609740b7edde2a9934a542c
@@@ -681,20 -540,35 +681,31 @@@ With optional CLEANUP, kill any associa
        (process-put proc 'jsonrpc-sentinel-cleanup-started t)
        (unwind-protect
            ;; Call all outstanding error handlers
 -          (maphash (lambda (_id triplet)
 -                     (pcase-let ((`(,_success ,error ,_timeout) triplet))
 -                       (funcall error '(:code -1 :message "Server died"))))
 -                   (jsonrpc--request-continuations connection))
 +          (mapc (jsonrpc-lambda (_id _method _success-fn error-fn _timer)
 +                  (funcall error-fn '(:code -1 :message "Server died")))
 +                (jsonrpc--continuations connection))
          (jsonrpc--message "Server exited with status %s" (process-exit-status proc))
          (delete-process proc)
 +        (when-let (p (slot-value connection '-autoport-inferior)) (delete-process p))
          (funcall (jsonrpc--on-shutdown connection) connection)))))
  
 -(defvar jsonrpc--in-process-filter nil
 -  "Non-nil if inside `jsonrpc--process-filter'.")
 -
  (cl-defun jsonrpc--process-filter (proc string)
    "Called when new data STRING has arrived for PROC."
+   (when jsonrpc--in-process-filter
+     ;; Problematic recursive process filters may happen if
+     ;; `jsonrpc-connection-receive', called by us, eventually calls
+     ;; client code which calls `process-send-string' (which see) to,
+     ;; say send a follow-up message.  If that happens to writes enough
+     ;; bytes for pending output to be received, we will lose JSONRPC
+     ;; messages.  In that case, remove recursiveness by re-scheduling
+     ;; ourselves to run from within a timer as soon as possible
+     ;; (bug#60088)
+     (run-at-time 0 nil #'jsonrpc--process-filter proc string)
+     (cl-return-from jsonrpc--process-filter))
    (when (buffer-live-p (process-buffer proc))
      (with-current-buffer (process-buffer proc)
 -      (let* ((jsonrpc--in-process-filter t)
 -             (connection (process-get proc 'jsonrpc-connection))
 -             (expected-bytes (jsonrpc--expected-bytes connection)))
 +      (let* ((conn (process-get proc 'jsonrpc-connection))
 +             (expected-bytes (jsonrpc--expected-bytes conn)))
          ;; Insert the text, advancing the process marker.
          ;;
          (save-excursion
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc lisp/term.el
Simple merge
diff --cc lisp/treesit.el
Simple merge
diff --cc lisp/window.el
Simple merge
diff --cc src/editfns.c
Simple merge