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

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

[elpa] externals/consult 4fd7cfa061 1/2: consult-line: Enforce global co


From: ELPA Syncer
Subject: [elpa] externals/consult 4fd7cfa061 1/2: consult-line: Enforce global completion style settings
Date: Thu, 14 Nov 2024 12:57:45 -0500 (EST)

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

    consult-line: Enforce global completion style settings
    
    Ensure that the global completion style settings are used for 
`consult-line`,
    `consult-focus-lines` and `consult-keep-lines` filtering. This override is
    necessary since users may want to override the settings buffer-locally for
    in-buffer completion, e.g., via Corfu.
---
 consult.el | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/consult.el b/consult.el
index 93de0a40a0..e9780f49f0 100644
--- a/consult.el
+++ b/consult.el
@@ -653,11 +653,18 @@ Turn ARG into a list, and for each element either:
 CATEGORY is the completion category, used to find the completion style via
 `completion-category-defaults' and `completion-category-overrides'.
 HIGHLIGHT must be non-nil if the resulting strings should be highlighted."
-  ;; completion-all-completions returns an improper list
-  ;; where the last link is not necessarily nil.
-  (nconc (completion-all-completions pattern cands nil (length pattern)
-                                     `(metadata (category . ,category)))
-         nil))
+  ;; Ensure that the global completion style settings are used for
+  ;; `consult-line', `consult-focus-lines' and `consult-keep-lines' filtering.
+  ;; This override is necessary since users may want to override the settings
+  ;; buffer-locally for in-buffer completion via Corfu.
+  (let ((completion-styles (default-value 'completion-styles))
+        (completion-category-defaults (default-value 
'completion-category-defaults))
+        (completion-category-overrides (default-value 
'completion-category-overrides)))
+    ;; `completion-all-completions' returns an improper list where the last 
link
+    ;; is not necessarily nil.
+    (nconc (completion-all-completions pattern cands nil (length pattern)
+                                       `(metadata (category . ,category)))
+           nil)))
 
 (defun consult--completion-filter-complement (pattern cands category 
_highlight)
   "Filter CANDS with complement of PATTERN.



reply via email to

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