[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/embark 000e447a4a 1/2: Support generic multi-category
From: |
ELPA Syncer |
Subject: |
[elpa] externals/embark 000e447a4a 1/2: Support generic multi-category |
Date: |
Wed, 29 Dec 2021 13:57:38 -0500 (EST) |
branch: externals/embark
commit 000e447a4afa486492e7e54cb32ced036ccd5c20
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Support generic multi-category
The consult-multi category can be useful for other packages besides
Consult. For example the Citar package has a completion command which
offers both files and urls. We keep consult-multi support for a short
transition period.
---
embark-consult.el | 13 -------------
embark.el | 12 +++++++++++-
2 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/embark-consult.el b/embark-consult.el
index 7118c7f695..40529001c1 100644
--- a/embark-consult.el
+++ b/embark-consult.el
@@ -201,19 +201,6 @@ The elements of LINES are assumed to be values of category
`consult-line'."
(setf (alist-get 'consult-grep embark-collect-initial-view-alist)
'list)
-;;; Support for consult-multi
-
-(defun embark-consult--multi-transform (_type target)
- "Refine `consult-multi' TARGET to its real type.
-This function takes a target of type `consult-multi' (from
-Consult's `consult-multi' category) and transforms it to its
-actual type."
- (or (get-text-property 0 'consult-multi target)
- (cons 'general target)))
-
-(setf (alist-get 'consult-multi embark-transformer-alist)
- #'embark-consult--multi-transform)
-
;;; Support for consult-isearch
(setf (alist-get 'consult-isearch embark-transformer-alist)
diff --git a/embark.el b/embark.el
index aab89a552c..752d75b7c3 100644
--- a/embark.el
+++ b/embark.el
@@ -178,7 +178,10 @@ bounds pair of the target at point for highlighting."
(symbol . embark--refine-symbol-type)
(embark-keybinding . embark--keybinding-command)
(project-file . embark--project-file-full-path)
- (package . embark--remove-package-version))
+ (package . embark--remove-package-version)
+ (multi-category . embark--refine-multi-category)
+ ;; TODO: `consult-multi' has been obsoleted by `multi-category'. Remove!
+ (consult-multi . embark--refine-multi-category))
"Alist associating type to functions for transforming targets.
Each function should take a type and a target string and return a
pair of the form a `cons' of the new type and the new target."
@@ -1819,6 +1822,13 @@ minibuffer before executing the action."
action target quit))))))))
(if quit (embark--quit-and-run run-action) (funcall run-action)))))
+(defun embark--refine-multi-category (_type target)
+ "Refine `multi-category' TARGET to its actual type."
+ (or (get-text-property 0 'multi-category target)
+ ;; TODO: `consult-multi' has been obsoleted by `multi-category'. Remove!
+ (get-text-property 0 'consult-multi target)
+ (cons 'general target)))
+
(defun embark--refine-symbol-type (_type target)
"Refine symbol TARGET to command or variable if possible."
(cons (let ((symbol (intern-soft target))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/embark 000e447a4a 1/2: Support generic multi-category,
ELPA Syncer <=