branch: externals/hotfuzz
commit b7e1fabfccbecc68e7e6ce3b5d9e292fe3c5921d
Author: Axel Forsman <[email protected]>
Commit: Axel Forsman <[email protected]>

    Remove Selectrum integration
    
    Selectrum has been deprecated in favor of Vertico, see
    radian-software/selectrum#601.
---
 README.md     | 14 +++++---------
 hotfuzz.el    | 36 ------------------------------------
 test/tests.el | 10 ----------
 3 files changed, 5 insertions(+), 55 deletions(-)

diff --git a/README.md b/README.md
index 0e94ed1cd1..619bdfe33f 100644
--- a/README.md
+++ b/README.md
@@ -13,16 +13,11 @@ To use hotfuzz, add it to the `completion-styles` list:
 ```elisp
 (setq completion-styles '(hotfuzz))
 ```
-
-Or, if using
-[Fido](https://www.gnu.org/software/emacs/manual/html_node/emacs/Icomplete.html),
-add hotfuzz to the `completion-styles` list this way:
-
+Or, if using [Fido], add hotfuzz to the `completion-styles` list this way:
 ```elisp
 (add-hook 'icomplete-minibuffer-setup-hook
           (lambda () (setq-local completion-styles '(hotfuzz))))
 ```
-or, if using [Selectrum], enable `hotfuzz-selectrum-mode`.
 
 **Note:** Highlighting of the matched characters is only applied to
 the first `hotfuzz-max-highlighted-completions` completions, out of
@@ -36,8 +31,8 @@ using
 ```
 provided you are completing small enough lists and/or do not encounter
 performance problems.
-This is a non-issue when using `hotfuzz-selectrum-mode` since
-Selectrum supports lazy highlighting.
+This is a non-issue when using `hotfuzz-vertico-mode` since
+Vertico supports lazy highlighting.
 
 ## Customization
 
@@ -106,7 +101,8 @@ but does no sorting and allows the individual sub-patterns 
to overlap
 Hotfuzz on the other hand tries to be more *clever* about sorting,
 and so users who dislike that may prefer orderless.
 
-[Selectrum]: https://github.com/raxod502/selectrum
+[Vertico]: https://github.com/minad/vertico
+[Fido]: 
https://www.gnu.org/software/emacs/manual/html_node/emacs/Icomplete.html
 [flx]: https://github.com/lewang/flx
 [Ido]: https://www.gnu.org/software/emacs/manual/html_node/ido/index.html
 [orderless]: https://github.com/oantolin/orderless
diff --git a/hotfuzz.el b/hotfuzz.el
index 8b649c067f..cc26a5a7a4 100644
--- a/hotfuzz.el
+++ b/hotfuzz.el
@@ -215,42 +215,6 @@ list before passing it to `display-sort-function' or
                '(hotfuzz completion-flex-try-completion hotfuzz-all-completions
                          "Fuzzy completion.")))
 
-;;; Selectrum integration
-
-(defun hotfuzz--highlight-all (string candidates)
-  "Highlight where STRING matches in the elements of CANDIDATES."
-  (mapcar (lambda (candidate)
-            (hotfuzz-highlight string (copy-sequence candidate)))
-          candidates))
-
-(defvar selectrum-refine-candidates-function)
-(defvar selectrum-highlight-candidates-function)
-
-(defvar hotfuzz--prev-selectrum-functions nil
-  "Previous values of the Selectrum sort/filter/highlight API endpoints.")
-
-;;;###autoload
-(define-minor-mode hotfuzz-selectrum-mode
-  "Minor mode that enables hotfuzz in Selectrum menus."
-  :global t
-  (if hotfuzz-selectrum-mode
-      (setq hotfuzz--prev-selectrum-functions
-            `(,(when (boundp 'selectrum-refine-candidates-function)
-                 selectrum-refine-candidates-function)
-              . ,(when (boundp 'selectrum-highlight-candidates-function)
-                   selectrum-highlight-candidates-function))
-            selectrum-refine-candidates-function #'hotfuzz-filter
-            selectrum-highlight-candidates-function #'hotfuzz--highlight-all)
-    (cl-flet ((restore
-               (sym old our &aux (standard (car (get sym 'standard-value))))
-               (cond ((not (eq (symbol-value sym) our)))
-                     (old (set sym old))
-                     (standard (set sym (eval standard t)))
-                     (t (makunbound sym)))))
-      (cl-destructuring-bind (old-rcf . old-hcf) 
hotfuzz--prev-selectrum-functions
-        (restore 'selectrum-refine-candidates-function old-rcf 
#'hotfuzz-filter)
-        (restore 'selectrum-highlight-candidates-function old-hcf 
#'hotfuzz--highlight-all)))))
-
 ;;; Vertico integration
 
 (declare-function vertico--all-completions "ext:vertico")
diff --git a/test/tests.el b/test/tests.el
index 4b86e741a2..601ee63ee5 100644
--- a/test/tests.el
+++ b/test/tests.el
@@ -98,16 +98,6 @@
        6) ; Point as in "/usr/s|/man"
       '("share/" . 5)))))
 
-;;; Selectrum integration
-
-(ert-deftest hotfuzz-selectrum-mode-toggle-test ()
-  (hotfuzz-selectrum-mode)
-  (hotfuzz-selectrum-mode -1)
-  ;; Have to unbind variables when disabling for them to be set to
-  ;; their standard values when Selectrum is loaded.
-  (should-not (or (boundp 'selectrum-refine-candidates-function)
-                  (boundp 'selectrum-highlight-candidates-function))))
-
 ;;; Vertico integration
 
 (ert-deftest vertico--all-completions-advice-test ()

Reply via email to