unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrew Schwartzmeyer <andrew@schwartzmeyer.com>
To: "João Távora" <joaotavora@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Add user customization fido-completion-styles
Date: Sun, 31 May 2020 21:37:23 -0700	[thread overview]
Message-ID: <953E1512-6420-4AE8-AF29-15AB151B6344@schwartzmeyer.com> (raw)
In-Reply-To: <F4A31A50-D008-48AF-BDDA-5A37D9AC67BF@schwartzmeyer.com>

[-- Attachment #1: Type: text/plain, Size: 1933 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 3630 bytes --]

  reply	other threads:[~2020-06-01  4:37 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-31 21:02 Add user customization fido-completion-styles Andrew Schwartzmeyer
2020-05-31 23:43 ` João Távora
2020-05-31 23:59   ` Dmitry Gutov
2020-06-01  0:21     ` João Távora
2020-06-01  0:37   ` Andrew Schwartzmeyer
2020-06-01  4:37     ` Andrew Schwartzmeyer [this message]
2020-06-02 11:14       ` João Távora
2020-06-02 16:14         ` Drew Adams
2020-06-02 17:51           ` João Távora
2020-06-02 18:11             ` Eli Zaretskii
2020-06-02 18:24               ` João Távora
2020-06-02 18:35                 ` Eli Zaretskii
2020-06-02 19:11                   ` João Távora
2020-06-02 19:25                     ` Eli Zaretskii
2020-06-02 20:00                       ` João Távora
2020-06-02 20:51             ` Drew Adams
2020-06-02 15:40   ` Tassilo Horn
2020-06-02 15:55     ` João Távora
2020-06-02 16:47       ` Tassilo Horn
2020-06-02 17:03         ` João Távora
2020-06-02 18:05           ` Tassilo Horn
2020-06-02 17:10         ` Tassilo Horn
2020-06-02 19:28           ` João Távora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=953E1512-6420-4AE8-AF29-15AB151B6344@schwartzmeyer.com \
    --to=andrew@schwartzmeyer.com \
    --cc=emacs-devel@gnu.org \
    --cc=joaotavora@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).