branch: externals/vertico commit d57d3904f2edf1c38827a7f90f91a2b756ce7369 Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
Support partial completion for files Sorting by history does not yet work for partial completion. It is difficult to support this efficiently. --- README.org | 12 +++++++++--- minicomp.el | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/README.org b/README.org index 6a7e554..90e28ab 100644 --- a/README.org +++ b/README.org @@ -24,7 +24,13 @@ Complementary packages, which are supported: * Configuration #+begin_src emacs-lisp -(use-package minicomp - :init - (minicomp-mode)) + (use-package minicomp + :init + (minicomp-mode)) + + (use-package orderless + :init + (setq completion-styles '(orderless) + completion-category-defaults nil + completion-category-overrides '((file (styles . (partial-completion)))))) #+end_src diff --git a/minicomp.el b/minicomp.el index c336839..78dda0f 100644 --- a/minicomp.el +++ b/minicomp.el @@ -34,6 +34,7 @@ ;;; Code: (require 'seq) +(require 'cl-lib) (eval-when-compile (require 'subr-x)) @@ -231,7 +232,7 @@ 0)) (total)) (when (eq (completion-metadata-get metadata 'category) 'file) - (setq all (delete "../" (delete "./" all)))) + (setq all (cl-delete-if (apply-partially #'string-match-p "\\(\\`\\|/\\)\\.?\\./\\'") all))) (setq total (length all) all (if (> total minicomp-sort-threshold) all