From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: Add user customization fido-completion-styles Date: Tue, 2 Jun 2020 16:55:45 +0100 Message-ID: References: <87r1uzn018.fsf@gmail.com> <87lfl5fpbx.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000714b1b05a71bf2a1" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="100789"; mail-complaints-to="usenet@ciao.gmane.io" To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= , Andrew Schwartzmeyer , emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jun 02 17:58:08 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 1jg9Il-000Q5h-QW for ged-emacs-devel@m.gmane-mx.org; Tue, 02 Jun 2020 17:58:07 +0200 Original-Received: from localhost ([::1]:34204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jg9Ik-000332-Ra for ged-emacs-devel@m.gmane-mx.org; Tue, 02 Jun 2020 11:58:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jg9Gh-0000RC-CU for emacs-devel@gnu.org; Tue, 02 Jun 2020 11:55:59 -0400 Original-Received: from mail-il1-x136.google.com ([2607:f8b0:4864:20::136]:33254) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jg9Gg-0001G3-6L for emacs-devel@gnu.org; Tue, 02 Jun 2020 11:55:58 -0400 Original-Received: by mail-il1-x136.google.com with SMTP id z2so5083096ilq.0 for ; Tue, 02 Jun 2020 08:55:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=hhWf9HwNtq4NkLZi6uYkvAm1hfiWjM5xPOg/TT4lpGE=; b=bvaSi14hSk2TPBls62ev/SeznwI5On9vk2+Bp92Sru6UFd3x8VHfr1SB4gMZqWt7tf N2ArlaX/bWkxaIXvlxUc9joaDb92V1bj/EQl6AoKC5ZkmP8xTwKOoZAAHIUMfBzLxegv oThlEFWyrhCuiN1o/aVwLtXdQi225ZUOfbGdk6FkL3r61O86XUj5nvqJ3ePV88HIHqaM LB87vPFNpeaBEI+e02YRLk0wTs9+eco/FnrdEBZEcgtrDA23Lpr068gKcx7VVdzoOsWv r/IeZCt+GwSBk2cL48Ot83bF9ITkj/alqC/rfY2/Ox+Y4geJIiSZ4QkNR7oqpEOC43X/ nZPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=hhWf9HwNtq4NkLZi6uYkvAm1hfiWjM5xPOg/TT4lpGE=; b=CwcVrQ2X3e2y20S+7c5sWo5wjp8XLGIlTOcS5nLwMhEV8qIAtYwMhRVLDAy7FOppfE G9C8H7jycye2EqTUVOXqGxdEZ3jWyPo80Zy0zMH2pdUdDNvy1xljUpVqn5x034Lz5vex AcMTqfDIkqWjWk9Inpa88GAMoT4quQP0Hcx+Gxa59aLxCOAS7fLkyT3tw9hoY+SnlYOq dK7NRHbe0K6MWuFpBPJGudpdZfkg44hE8EyggteA1lrvqt83+9UPlycJpXHuAxJkalbM ou8mWt8LbWQSGO8fkBPF8RDFwZBxYqeJw7ADtrpoGVug+bdkfQAIejkr7S/Pq1PEm18U PpEw== X-Gm-Message-State: AOAM531CVqZurRfiditmJfLZf79KV5ob5j54pT8wcwNPd9X/FVVs7FXE KeNI+qViXKDrgCJxpXuTqOkPWpT/fiwviCwvqFw= X-Google-Smtp-Source: ABdhPJzmFXv+76K1mOKmoRxyHdvo9QzmZmYysjf5OTt77n0gOPrviVp0KpXkU3rr8SCSrcP+Yzw8l/2yTuDdUo7sD/s= X-Received: by 2002:a05:6e02:c:: with SMTP id h12mr72212ilr.125.1591113357018; Tue, 02 Jun 2020 08:55:57 -0700 (PDT) In-Reply-To: <87lfl5fpbx.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::136; envelope-from=joaotavora@gmail.com; helo=mail-il1-x136.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FROM_EXCESS_BASE64=0.979, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:251761 Archived-At: --000000000000714b1b05a71bf2a1 Content-Type: text/plain; charset="UTF-8" On Tue, Jun 2, 2020 at 4:40 PM Tassilo Horn wrote: > > (add-hook 'icomplete-minibuffer-setup-hook 'my-flex-styles) > > (defun my-flex-styles () (setq-local completion-styles '(initials flex))) > > > > Or just use a lambda, which is even shorter. I'd like to avoid a > > duplicate version of completion-styles customization vars. > > I guess fido-mode sets `completion-styles' locally in order to achieve > ido-like defaults, right? Yes, exactly. fido-mode is broadly "choose these nice icomplete-mode settings that make it fake ido-mode". > But as a user with customized > `completion-styles' and `completion-category-overrides', I wish there > was a simple way to just use them with fido, too. You can try icomplete-mode directly if you don't like fido-mode's. fido-mode is a small customization layer on top of it that makes some choices for you. > Especially, I can't > see how I could figure out the right category override. Is the > completion metadata accessible in icomplete-minibuffer-setup-hook? I don't know what you mean. Exactly what are you trying do to? Anyway, I'm reasonably confident you can set completion-category-overrides there. > I would like to use fido (more than icomplete) because the keybindings > suite my intuition but I'd like to keep my completion styles and > overrides as I have them. If (some of the keybindings) are the only thing that interest you, you can bind them to icomplete-minibuffer-map. The only thing you can't do this way is this bit of behaviour hidden in `icomplete--sorted-completions' ((and fido-mode (not minibuffer-default) (eq (icomplete--category) 'file)) ;; `fido-mode' has some extra file-sorting ;; semantics even if there isn't a default, ;; which is to bubble "./" to the top if it ;; exists. This makes M-x dired RET RET go to ;; the directory of current file, which is ;; what vanilla Emacs and `ido-mode' both do. `(,(lambda (comp) (string= "./" comp)))) But _that_ could be controlled by an icomplete variable or some other category technique. Also, you can argue for some of the defaults in icomplete to be changed, slowly. --000000000000714b1b05a71bf2a1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Jun 2, 2020 at 4:40 PM Tassilo Horn <tsdh@gnu.org> wrote:

> > =C2=A0 (= add-hook 'icomplete-minibuffer-setup-hook 'my-flex-styles)
> = > =C2=A0 (defun my-flex-styles () (setq-local completion-styles '(in= itials flex)))
> >
> > Or just use a lambda, which is eve= n shorter.=C2=A0 I'd like to avoid a
> > duplicate version of = completion-styles customization vars.
>
> I guess fido-mode set= s `completion-styles' locally in order to achieve
> ido-like defa= ults, right?

Yes, exactly. fido-mode is broadly "choose th= ese nice icomplete-mode
settings that make it fake ido-mode"= .

> But as a user with customized
> `completion-style= s' and `completion-category-overrides', I wish there
> was a = simple way to just use them with fido, too.

You can try icomplete-mo= de directly if you don't like fido-mode's.
fido-mode is a small = customization layer on top of it that makes
some choices for you.
> Especially, I can't
> see how I could figure out the right = category override.=C2=A0 Is the
> completion metadata accessible in i= complete-minibuffer-setup-hook?

I don't know what you mean.= =C2=A0 Exactly what are you trying do to?
Anyway, I'm reasona= bly confident you can set
completion-category-overrides ther= e.

> I would like to use fido (more than icomplete) because= the keybindings
> suite my intuition but I'd like to keep my com= pletion styles and
> overrides as I have them.

If (some of the= keybindings) are the only thing that interest you,
you can bind them to= icomplete-minibuffer-map.=C2=A0 The only thing
you can't do this wa= y is this bit of behaviour hidden in
`icomplete--sorted-completions'=

((and fido-mode
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(n= ot minibuffer-default)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(eq (icomplete--cate= gory) 'file))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; `fido-mode' has some extra file-sort= ing
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 ;; semantics even if there isn't a default,
=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 ;; which is to bubble "./" to the top if it
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; ex= ists.=C2=A0 This makes M-x dired RET RET go to
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; the director= y of current file, which is
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; what vanilla Emacs and `ido-mo= de' both do.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 `(,(lambda (comp)
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(string=3D "./" comp))))

But _that= _ could be controlled by an icomplete variable or some
other cat= egory technique.

Also, you can argue for some of t= he defaults in icomplete to be
changed, slowly.
--000000000000714b1b05a71bf2a1--