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: Andrew Schwartzmeyer
Subject: Re: Add user customization fido-completion-styles
Date: Sun, 31 May 2020 21:37:23 -0700

Okay so re:

On May 31, 2020, at 5:37 PM, Andrew Schwartzmeyer <andrew@schwartzmeyer.com> wrote:

Honestly, the strangest thing in my experience so far is that M-x with “flex” style doesn’t start with my historical items, just seemingly random (but static) commands. It seems like switching it to “initials flex” already pulls in my history as default sort, but I need to investigate further and be sure it isn’t something else. I think an integral part to any completion framework is for the initial suggestions to follow frequency/recency, to provide good context with no input, and allow immediate selection of frequently/recently used commands (buffers, files…).

With just “flex” as the completion style, for some reason M-x with no input (from an emacs -q) presents the following candidates as the first:

icomplete-fido-delete-char
enable-theme
url-setup-privacy-info
dired-at-point
tab-bar-select-tab

I can’t see a pattern in these. If I then call a command, I’d want/expect (from experience with other completion frameworks) the next use of M-x to show it as the first candidate, but it doesn’t.

Now if I use the aforementioned Orderless package and the minibuffer hook to use it as the completion style in fido, somehow it does some magic such that M-x (which is still bound to execute-extended-command) now has some history sorting! (Working for switch-to-buffer too. :)

For repro:

(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(package-refresh-contents)
(package-install 'orderless)
(add-hook 'icomplete-minibuffer-setup-hook
 (lambda () (setq-local completion-styles '(orderless))))
(fido-mode)

So yeah, I’m off to look through Orderless to see what magic it does that sorts the candidates for M-x (without having do anything like what smex does!).

Cheers,

Andy

reply via email to

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