From: Felicián Németh Date: Sat, 11 Jan 2020 19:12:26 +0000 (+0100) Subject: Fix eglot-completion-at-point for multiple matches X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~183 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=581dfb79bffc25a2ef8879aee4862817f6c21e79;p=emacs.git Fix eglot-completion-at-point for multiple matches The test-completion case shouldn't return t when there are multiple matches. Similarly, the try-completion should return t only if the match is exact. See (info "(elisp)Programmed Completion"). * eglot.el (eglot-completion-at-point): Instead of testing memberships, use test-completion and try-completion suggested by (info "(elisp)Programmed Completion"). * eglot-tests.el (non-unique-completions): Add new test. Co-authored-by: João Távora GitHub-reference: fix https://github.com/joaotavora/eglot/issues/365 --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 0447bc85041..98fa4d9af6f 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -2154,10 +2154,10 @@ is not active." (cond ((eq action 'metadata) metadata) ; metadata ((eq action 'lambda) ; test-completion - (member probe (funcall proxies))) + (test-completion probe (funcall proxies))) ((eq (car-safe action) 'boundaries) nil) ; boundaries - ((and (null action) ; try-completion - (member probe (funcall proxies)) t)) + ((null action) ; try-completion + (try-completion probe (funcall proxies))) ((eq action t) ; all-completions (cl-remove-if-not (lambda (proxy)