]> git.eshelyaron.com Git - emacs.git/commitdiff
Flex completion style is not available on emacs < 27
authorJürgen Hötzel <juergen@hoetzel.info>
Tue, 5 Jan 2021 10:56:06 +0000 (11:56 +0100)
committerGitHub <noreply@github.com>
Tue, 5 Jan 2021 10:56:06 +0000 (10:56 +0000)
* eglot.el (eglot--managed-mode): check if flex style available

Copyright-paperwork-exempt: yes
GitHub-reference: fix https://github.com/joaotavora/eglot/issues/582

lisp/progmodes/eglot.el

index c7f70ea141e8a3a3b9ae767322012f680d09603a..9267a138bd367a7f59a21d3544eb030f8f8ba663 100644 (file)
@@ -1362,7 +1362,8 @@ Use `eglot-managed-p' to determine if current buffer is managed.")
     (eglot--setq-saving flymake-diagnostic-functions '(eglot-flymake-backend t))
     (eglot--setq-saving company-backends '(company-capf))
     (eglot--setq-saving company-tooltip-align-annotations t)
-    (eglot--setq-saving completion-styles '(flex basic))
+    (when (assoc 'flex completion-styles-alist)
+      (eglot--setq-saving completion-styles '(flex basic)))
     (unless (eglot--stay-out-of-p 'imenu)
       (add-function :before-until (local 'imenu-create-index-function)
                     #'eglot-imenu))