emacs-devel
[Top][All Lists]
Advanced

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

Re: Add user customization fido-completion-styles


From: Tassilo Horn
Subject: Re: Add user customization fido-completion-styles
Date: Tue, 02 Jun 2020 19:10:13 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hi again,

> I don't know when this happens, but it might be that it is before
> `icomplete-minibuffer-setup-hook' is called and then setting
> `completion-category-overrides' wouldn't have an effect.  I'll test...

Ok, nothing to worry, it seems to work with those configs.

--8<---------------cut here---------------start------------->8---
(defvar th/completion-styles
  '(basic partial-completion substring flex))

(defvar th/completion-category-overrides
  '((ecomplete
     (styles basic partial-completion substring))
    (buffer
     (styles basic partial-completion substring))
    (unicode-name
     (styles basic partial-completion flex))
    (info-menu
     (styles basic partial-completion flex))
    (project-file
     (styles basic partial-completion substring initials))
    (file
     (styles basic partial-completion substring initials))
    ;; TODO: There's actually no command category (yet).
    (command (styles basic partial-completion substring initials))))

(setq read-buffer-completion-ignore-case t
      read-file-name-completion-ignore-case t
      completion-cycle-threshold 3
      completion-styles th/completion-styles
      completion-category-overrides th/completion-category-overrides)

(defun th/icomplete-minibuffer-setup-init ()
  (when fido-mode
    (setq-local completion-styles th/completion-styles)
    (setq-local completion-category-overrides
                th/completion-category-overrides)))

(add-hook 'icomplete-minibuffer-setup-hook
          #'th/icomplete-minibuffer-setup-init)

(fido-mode)
--8<---------------cut here---------------end--------------->8---



reply via email to

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