From: João Távora Date: Fri, 29 Nov 2019 23:33:12 +0000 (+0000) Subject: Unbreak window/showmessagerequest X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~267 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=86da1f615c0d1087b504c4b52347ac1b765834a2;p=emacs.git Unbreak window/showmessagerequest * eglot.el (eglot-handle-request): Answer with a proper MessageActionItem. GitHub-reference: fix https://github.com/joaotavora/eglot/issues/362 --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 90f2c684745..b3a7f518267 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1450,16 +1450,16 @@ COMMAND is a symbol naming the command." (cl-defmethod eglot-handle-request (_server (_method (eql window/showMessageRequest)) &key type message actions) "Handle server request window/showMessageRequest" - (or (completing-read - (concat - (format (propertize "[eglot] Server reports (type=%s): %s" - 'face (if (<= type 1) 'error)) - type message) - "\nChoose an option: ") - (or (mapcar (lambda (obj) (plist-get obj :title)) actions) - '("OK")) - nil t (plist-get (elt actions 0) :title)) - (jsonrpc-error :code -32800 :message "User cancelled"))) + (let ((label (completing-read + (concat + (format (propertize "[eglot] Server reports (type=%s): %s" + 'face (if (<= type 1) 'error)) + type message) + "\nChoose an option: ") + (or (mapcar (lambda (obj) (plist-get obj :title)) actions) + '("OK")) + nil t (plist-get (elt actions 0) :title)))) + (if label `(:title ,label) :null))) (cl-defmethod eglot-handle-notification (_server (_method (eql window/logMessage)) &key _type _message)