From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Andrew Schwartzmeyer Newsgroups: gmane.emacs.devel Subject: Re: Add user customization fido-completion-styles Date: Sun, 31 May 2020 21:37:23 -0700 Message-ID: <953E1512-6420-4AE8-AF29-15AB151B6344@schwartzmeyer.com> References: <87r1uzn018.fsf@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_C6C9935B-52B7-4C76-BA6D-43D4F24C901B" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="73433"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jun 01 06:38:15 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jfcDH-000J1k-1d for ged-emacs-devel@m.gmane-mx.org; Mon, 01 Jun 2020 06:38:15 +0200 Original-Received: from localhost ([::1]:38942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfcDF-0003kb-Vl for ged-emacs-devel@m.gmane-mx.org; Mon, 01 Jun 2020 00:38:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58980) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfcCa-0003Bs-Bt for emacs-devel@gnu.org; Mon, 01 Jun 2020 00:37:32 -0400 Original-Received: from mout01.posteo.de ([185.67.36.141]:43656) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfcCY-0006UA-If for emacs-devel@gnu.org; Mon, 01 Jun 2020 00:37:32 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 427D8160060 for ; Mon, 1 Jun 2020 06:37:28 +0200 (CEST) Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 49b2TK4P03z6tmH; Mon, 1 Jun 2020 06:37:25 +0200 (CEST) In-Reply-To: X-Mailer: Apple Mail (2.3608.80.23.2.2) Received-SPF: pass client-ip=185.67.36.141; envelope-from=andrew@schwartzmeyer.com; helo=mout01.posteo.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/01 00:37:28 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:251707 Archived-At: --Apple-Mail=_C6C9935B-52B7-4C76-BA6D-43D4F24C901B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Okay so re: > On May 31, 2020, at 5:37 PM, Andrew Schwartzmeyer = wrote: >=20 > Honestly, the strangest thing in my experience so far is that M-x with = =E2=80=9Cflex=E2=80=9D style doesn=E2=80=99t start with my historical = items, just seemingly random (but static) commands. It seems like = switching it to =E2=80=9Cinitials flex=E2=80=9D already pulls in my = history as default sort, but I need to investigate further and be sure = it isn=E2=80=99t 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=E2=80=A6). With just =E2=80=9Cflex=E2=80=9D 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=E2=80=99t see a pattern in these. If I then call a command, I=E2=80=99= 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=E2=80=99t.= 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=E2=80=99m 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= --Apple-Mail=_C6C9935B-52B7-4C76-BA6D-43D4F24C901B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 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 =E2=80=9Cflex=E2=80=9D style = doesn=E2=80=99t start with my historical items, just seemingly random = (but static) commands. It seems like switching it to =E2=80=9Cinitials = flex=E2=80=9D already pulls in my history as default sort, but I need to = investigate further and be sure it isn=E2=80=99t 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=E2=80=A6).

With just =E2=80=9Cflex=E2=80=9D 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=E2=80=99t see a pattern in these. = If I then call a command, I=E2=80=99d want/expect (from experience with = other completion frameworks) the next use of M-x to show it as the first = candidate, but it doesn=E2=80=99t.

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=E2=80=99m 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
= --Apple-Mail=_C6C9935B-52B7-4C76-BA6D-43D4F24C901B--