]> git.eshelyaron.com Git - emacs.git/commitdiff
Use completing-read in eglot-code-actions
authorTheodor Thornhill <theo@thornhill.no>
Thu, 2 Jan 2020 09:33:26 +0000 (10:33 +0100)
committerJoão Távora <joaotavora@gmail.com>
Thu, 2 Jan 2020 09:33:26 +0000 (09:33 +0000)
See also https://github.com/joaotavora/eglot/issues/386.

* eglot.el (eglot-code-actions): Replace tmm with completing-read

Copyright-paperwork-exempt: yes
Co-authored-by: João Távora <joaotavora@gmail.com>
GitHub-reference: close https://github.com/joaotavora/eglot/issues/393

lisp/progmodes/eglot.el

index 0d2433e9c0581462ab37277b89f58843f9b4af56..d1ff7da5d9ccca538a436c94150038d8b9890d62 100644 (file)
@@ -2466,12 +2466,10 @@ potentially rename EGLOT's help buffer."
          (menu `("Eglot code actions:" ("dummy" ,@menu-items)))
          (action (if (listp last-nonmenu-event)
                      (x-popup-menu last-nonmenu-event menu)
-                   (let ((never-mind (gensym)) retval)
-                     (setcdr (cadr menu)
-                             (cons `("never mind..." . ,never-mind) (cdadr menu)))
-                     (if (eq (setq retval (tmm-prompt menu)) never-mind)
-                         (keyboard-quit)
-                       retval)))))
+                   (cdr (assoc (completing-read "[eglot] Pick an action: " 
+                                               menu-items nil t
+                                               nil nil (car menu-items))
+                               menu-items)))))
     (eglot--dcase action
         (((Command) command arguments)
          (eglot-execute-command server (intern command) arguments))