emacs-31 cf98d9d725f: Eglot: do more orthodox use of progress reporters (bug#81514)

João Távora <[email protected]> Sat, 1 Aug 2026 05:54:50 -0400 (EDT)
Newsgroups gmane.emacs.diffs
Message-ID <[email protected]>
branch: emacs-31
commit cf98d9d725f034b3dd89f6f92a1c8205e778f98c
Author: João Távora <[email protected]>
Commit: João Távora <[email protected]>

    Eglot: do more orthodox use of progress reporters (bug#81514)
    
    The progress reporters on recent Emacs has backward incompatible
    changes, but our use of them wasn't too correct either.
    
    * lisp/progmodes/eglot.el (eglot-handle-notification): Call
    progress-reporter-done.
---
 lisp/progmodes/eglot.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index f701a38ab8b..0f0791d37ab 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -2872,7 +2872,8 @@ return it back to the server.  :null is returned if the list was empty."
                 (if (eq eglot-report-progress 'messages)
                     (make-progress-reporter
                      (format "[eglot] %s %s: %s"
-                             (eglot-project-nickname server) token title))
+                             (eglot-project-nickname server) token title)
+                     0 100)
                   (list 'eglot--mode-line-reporter token title)))
               (upd (pcnt msg &optional
                          (pr (gethash token (eglot--progress-reporters server))))
@@ -2880,7 +2881,10 @@ return it back to the server.  :null is returned if the list was empty."
                   ((eq (car pr) 'eglot--mode-line-reporter)
                    (setcdr (cddr pr) (list msg pcnt))
                    (force-mode-line-update t))
-                  (pr (eglot--reporter-update pr pcnt msg)))))
+                  (pr
+                   (if (eql pcnt 100)
+                       (progress-reporter-done pr)
+                     (eglot--reporter-update pr pcnt msg))))))
       (eglot--dbind ((WorkDoneProgress) kind title percentage message) value
         (pcase kind
           ("begin"