emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/consult 6161f60ecd 2/2: Drop Selectrum support


From: ELPA Syncer
Subject: [elpa] externals/consult 6161f60ecd 2/2: Drop Selectrum support
Date: Fri, 9 Dec 2022 14:57:26 -0500 (EST)

branch: externals/consult
commit 6161f60ecd53b1ad270eac6d787cb259f968a1e7
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Drop Selectrum support
    
    Selectrum has been deprecated in favor of Vertico.
---
 CHANGELOG.org        |   5 +++
 consult-selectrum.el | 100 ---------------------------------------------------
 consult.el           |   3 +-
 3 files changed, 7 insertions(+), 101 deletions(-)

diff --git a/CHANGELOG.org b/CHANGELOG.org
index d7d123ff84..ab10c8d021 100644
--- a/CHANGELOG.org
+++ b/CHANGELOG.org
@@ -2,6 +2,11 @@
 #+author: Daniel Mendler
 #+language: en
 
+* Development
+
+- Bugfixes
+- Drop Selectrum support
+
 * Version 0.29 (2022-12-03)
 
 - Bugfixes
diff --git a/consult-selectrum.el b/consult-selectrum.el
deleted file mode 100644
index 9cc16a2645..0000000000
--- a/consult-selectrum.el
+++ /dev/null
@@ -1,100 +0,0 @@
-;;; consult-selectrum.el --- Selectrum integration for Consult -*- 
lexical-binding: t -*-
-
-;; Copyright (C) 2021, 2022  Free Software Foundation, Inc.
-
-;; This file is part of GNU Emacs.
-
-;; This program is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Integration code for the Selectrum completion system. This package
-;; is automatically loaded by Consult.
-
-;;; Code:
-
-(require 'consult)
-
-;; NOTE: It is not guaranteed that Selectrum is available during compilation!
-(defvar selectrum-default-value-format)
-(defvar selectrum-highlight-candidates-function)
-(defvar selectrum-is-active)
-(defvar selectrum-refine-candidates-function)
-(defvar selectrum--history-hash)
-(declare-function selectrum-exhibit "ext:selectrum")
-(declare-function selectrum-get-current-candidate "ext:selectrum")
-
-(defun consult-selectrum--filter-adv (orig pattern cands category highlight)
-  "Advice for ORIG `consult--completion-filter' function.
-See `consult--completion-filter' for arguments PATTERN, CANDS, CATEGORY
-and HIGHLIGHT."
-  ;; Do not use selectrum-is-active here, since we want to always use
-  ;; the Selectrum filtering when Selectrum is installed, even when
-  ;; Selectrum is currently not active.
-  ;; However if `selectrum-refine-candidates-function' is the default
-  ;; function, which uses the completion styles, the Selectrum filtering
-  ;; is not used and the original function is called.
-  (if (and (eq completing-read-function 'selectrum-completing-read)
-           (not (eq selectrum-refine-candidates-function
-                    'selectrum-refine-candidates-using-completions-styles)))
-      (if highlight
-          (funcall selectrum-highlight-candidates-function pattern
-                   (funcall selectrum-refine-candidates-function pattern 
cands))
-        (funcall selectrum-refine-candidates-function pattern cands))
-    (funcall orig pattern cands category highlight)))
-
-(defun consult-selectrum--candidate ()
-  "Return current selectrum candidate."
-  (and selectrum-is-active (selectrum-get-current-candidate)))
-
-(defun consult-selectrum--refresh (&optional reset)
-  "Refresh completion UI, keep current candidate unless RESET is non-nil."
-  (when selectrum-is-active
-    (when consult--narrow
-      (setq-local selectrum-default-value-format nil))
-    (when reset
-      (setq-local selectrum--history-hash nil))
-    (selectrum-exhibit (not reset))))
-
-(defun consult-selectrum--split-wrap (orig split)
-  "Wrap candidates highlight/refinement ORIG function.
-The input is split by the SPLIT function."
-  (lambda (str cands)
-    (funcall orig (substring str (cadr (funcall split str))) cands)))
-
-(defun consult-selectrum--split-setup-adv (orig split)
-  "Advice for `consult--split-setup' to be used by Selectrum.
-
-ORIG is the original function.
-SPLIT is the splitter function."
-  (if (not selectrum-is-active)
-      (funcall orig split)
-    (setq-local
-     selectrum-refine-candidates-function
-     (consult-selectrum--split-wrap selectrum-refine-candidates-function split)
-     selectrum-highlight-candidates-function
-     (consult-selectrum--split-wrap selectrum-highlight-candidates-function 
split))))
-
-(defun consult-selectrum--deprecated (&rest _)
-  (warn (propertize "Consult (%s): Selectrum has been deprecated in favor of 
Vertico" 'face 'warning) this-command))
-
-(add-hook 'consult--completion-candidate-hook #'consult-selectrum--candidate)
-(add-hook 'consult--completion-refresh-hook #'consult-selectrum--refresh)
-(advice-add #'consult--completion-filter :around 
#'consult-selectrum--filter-adv)
-(advice-add #'consult--split-setup :around 
#'consult-selectrum--split-setup-adv)
-(define-key consult-async-map [remap selectrum-insert-current-candidate] 
'selectrum-next-page)
-(advice-add #'consult--read :before #'consult-selectrum--deprecated)
-
-(provide 'consult-selectrum)
-;;; consult-selectrum.el ends here
diff --git a/consult.el b/consult.el
index 807b8f0e94..c79f947c28 100644
--- a/consult.el
+++ b/consult.el
@@ -4983,9 +4983,10 @@ automatically previewed."
 ;;;; Integration with other completion systems
 
 (with-eval-after-load 'icomplete (require 'consult-icomplete))
-(with-eval-after-load 'selectrum (require 'consult-selectrum))
 (with-eval-after-load 'vertico (require 'consult-vertico))
 (with-eval-after-load 'mct (add-hook 'consult--completion-refresh-hook
                                      'mct--live-completions-refresh))
+(with-eval-after-load 'selectrum
+  (warn (propertize "Consult: Selectrum has been deprecated in favor of 
Vertico" 'face 'warning)))
 
 ;;; consult.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]