minad / cape

🦸cape.el - Completion At Point Extensions
GNU General Public License v3.0
584 stars 20 forks source link

Can not use separator with `cape-super-capf` #29

Closed theFool32 closed 2 years ago

theFool32 commented 2 years ago

I am using corfu+cape+orderless. However, I can not make corfu-insert-separator (M-SPC) work with cape-super-capf. For the following config:

;;; File for debugging Emacs setup

;; Setup package manager
(defvar bootstrap-version)
(setq straight-repository-branch "develop")

(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

(straight-use-package 'use-package)
(setq straight-use-package-by-default t)

(use-package corfu
  :config
  (corfu-global-mode)
  (setq tab-always-indent 'complete)
  (setq corfu-max-width 150))

(use-package cape
  :bind (("M-<tab>" . completion-at-point))
  :init
  ;; I'm on a Mac
  (setq cape-dict-file "/usr/share/dict/words")

  ;; Case 1
  ;; (add-to-list 'completion-at-point-functions
  ;;              (cape-super-capf #'cape-dabbrev #'cape-dict))

  ;; Case 2
  (add-to-list 'completion-at-point-functions #'cape-dict)
  (add-to-list 'completion-at-point-functions #'cape-dabbrev)
  )

(use-package emacs
  :defer t
  :init
  (setq enable-recursive-minibuffers t)
  (setq completion-cycle-threshold 1)
  (setq tab-always-indent 'complete))

(use-package orderless
  :demand t
  :config
  (setq completion-styles '(orderless)
        completion-category-defaults nil))

In both cases, I typed "to", then M-SPC and "y". In case 1, the results are highlighted, but not filtered.

image

In case 2, it works as expected.

image

Is this a bug or something I missed?

minad commented 2 years ago

There was indeed a bug. Fixed in e93aff671929177263068edfe5894e192840c3fe.