selectrum: improve company advice

- try `basic` and `partial-completion` completion styles before
  `orderless`, since `company-mode` is usually used in in-buffer
  completions where these often give much more relevant results than
  orderless, which can still be accessed by `&`.
This commit is contained in:
Itai Y. Efrat 2021-07-07 01:24:31 +03:00
parent d86375a468
commit 814c5b5c0c
2 changed files with 4 additions and 4 deletions

View file

@ -119,7 +119,6 @@ The clicking links exported grep buffers used to open in a new window, but now
*** TODO Open upstream Embark issue for ~bookmark~ and ~file~ *** TODO Open upstream Embark issue for ~bookmark~ and ~file~
~bookmark~ or ~file~ export buffers open the links in the same window rather than ~bookmark~ or ~file~ export buffers open the links in the same window rather than
the other one. This can be reproduces on emacs -Q. the other one. This can be reproduces on emacs -Q.
** TODO ~company~ completions get ordered really weirdly
This is due to orderless adding a bunch of other matches. This is due to orderless adding a bunch of other matches.
* PROJ Review non-blocking Issues * PROJ Review non-blocking Issues

View file

@ -2,10 +2,11 @@
;;;###autoload ;;;###autoload
(defadvice! +selectrum--company-capf--candidates-a (fn &rest args) (defadvice! +selectrum--company-capf--candidates-a (fn &rest args)
"Function to help company to highlight all candidates with just "Highlight company matches correctly, and try default completion styles before
one face." orderless."
:around 'company-capf--candidates :around 'company-capf--candidates
(let ((orderless-match-faces [completions-common-part])) (let ((orderless-match-faces [completions-common-part])
(completion-styles '(basic partial-completion orderless)))
(apply fn args))) (apply fn args)))
;;;###autoload ;;;###autoload