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

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

[elpa] externals/corfu 68d799a 2/6: Revert "Add corfu-completion-styles"


From: Protesilaos Stavrou
Subject: [elpa] externals/corfu 68d799a 2/6: Revert "Add corfu-completion-styles"
Date: Sat, 17 Apr 2021 18:26:55 -0400 (EDT)

branch: externals/corfu
commit 68d799a724c98de481f692b2fd36277ace378790
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Revert "Add corfu-completion-styles"
    
    This reverts commit 6e9b8ef9b96037b5ee1ff583eafdde4cd78842fe.
    
    Revert this for since it needs more thought (See #5).
---
 corfu.el | 24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)

diff --git a/corfu.el b/corfu.el
index 3532cc3..a873816 100644
--- a/corfu.el
+++ b/corfu.el
@@ -55,11 +55,6 @@
   "Enable cycling for `corfu-next' and `corfu-previous'."
   :type 'boolean)
 
-;; XXX Maybe there should be a `completion-in-region-styles' variable in Emacs
-(defcustom corfu-completion-styles nil
-  "Completion styles to use for completion in region, defaults to 
`completion-styles'."
-  :type '(choice (const nil) (repeat symbol)))
-
 (defgroup corfu-faces nil
   "Faces used by Corfu."
   :group 'corfu
@@ -275,8 +270,7 @@ If `line-spacing/=nil' or in text-mode, the background 
color is used instead.")
               (lambda (pattern cands)
                 (setq hl (lambda (x) (orderless-highlight-matches pattern x)))
                 cands)))
-    (let ((completion-styles (or corfu-completion-styles completion-styles)))
-      (cons (apply #'completion-all-completions args) hl))))
+    (cons (apply #'completion-all-completions args) hl)))
 
 (defun corfu--sort-predicate (x y)
   "Sorting predicate which compares X and Y."
@@ -477,11 +471,11 @@ If `line-spacing/=nil' or in text-mode, the background 
color is used instead.")
         (other other-window-scroll-buffer)
         (restore (make-symbol "corfu--restore")))
     (fset restore (lambda ()
-                    (when (eq this-command #'corfu-abort)
-                      (setq this-command #'ignore))
-                    (remove-hook 'pre-command-hook restore)
-                    (setq other-window-scroll-buffer other)
-                    (set-window-configuration config)))
+                 (when (eq this-command #'corfu-abort)
+                   (setq this-command #'ignore))
+                 (remove-hook 'pre-command-hook restore)
+                 (setq other-window-scroll-buffer other)
+                 (set-window-configuration config)))
     (run-at-time 0 nil (lambda () (add-hook 'pre-command-hook restore)))))
 
 ;; Company support, taken from `company.el', see `company-show-doc-buffer'.
@@ -528,8 +522,7 @@ If `line-spacing/=nil' or in text-mode, the background 
color is used instead.")
                  (pt (max 0 (- (point) beg)))
                  (str (buffer-substring-no-properties beg end))
                  (metadata (completion-metadata (substring str 0 pt) table 
pred)))
-      (pcase (let ((completion-styles (or corfu-completion-styles 
completion-styles)))
-               (completion-try-completion str table pred pt metadata))
+      (pcase (completion-try-completion str table pred pt metadata)
         ((and `(,newstr . ,newpt) (guard (not (equal str newstr))))
          (completion--replace beg end newstr)
          (goto-char (+ beg newpt)))))))
@@ -571,8 +564,7 @@ If `line-spacing/=nil' or in text-mode, the background 
color is used instead.")
 
 (defun corfu--completion-in-region (&rest args)
   "Corfu completion in region function passing ARGS to 
`completion--in-region'."
-  (let ((completion-styles (or corfu-completion-styles completion-styles))
-        (completion-show-inline-help)
+  (let ((completion-show-inline-help)
         (completion-auto-help))
     (apply #'completion--in-region args)))
 



reply via email to

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