unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrew Schwartzmeyer <andrew@schwartzmeyer.com>
To: emacs-devel@gnu.org
Cc: joaotavora@gmail.com
Subject: Add user customization fido-completion-styles
Date: Sun, 31 May 2020 14:02:28 -0700	[thread overview]
Message-ID: <CE231FAF-4C52-4680-A2F2-0F33D140D242@schwartzmeyer.com> (raw)

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

Hi,

Users of fido-mode (like me) may want to customize the completion style it uses, so add a variable to allow them to do so.

For instance, I really like using the “initials” style so “vlm” quickly completes visual-line-mode, and then falling back to flex. There are also neat packages like orderless (https://github.com/oantolin/orderless <https://github.com/oantolin/orderless>) which add a new completion-style, which folks may want to plug-in and use. Anyway, it seems like it ought to be customizable.

Thanks,

Andy

P.S. I wish “flex” were a bit faster. On my circa 2012 MacBook, M-x is noticeably slow with “flex” for commands. Also, I don’t know what “:version” to put on the defcustom, and the docs could be improved a bit.


[-- Attachment #2.1: Type: text/html, Size: 1310 bytes --]

[-- Attachment #2.2: 0001-Add-user-customization-fido-completion-styles.patch --]
[-- Type: application/octet-stream, Size: 1316 bytes --]

From 59177be2198aa9aa9d12d730f732456caf187f9e Mon Sep 17 00:00:00 2001
From: Andrew Schwartzmeyer <andrew@schwartzmeyer.com>
Date: Sun, 31 May 2020 13:55:13 -0700
Subject: [PATCH] Add user customization fido-completion-styles

Users of fido-mode may want to customize the completion style it uses,
so add a variable to allow them to do so.
---
 lisp/icomplete.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index c12f3901f..40626663f 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -134,6 +134,12 @@ icompletion is occurring."
   :type 'hook
   :group 'icomplete)
 
+(defcustom fido-completion-styles '(flex)
+  "Completion styles used by `fido-mode'.
+See `completion-styles'"
+  :type completion--styles-type
+  :group 'icomplete)
+
 
 ;;;_* Initialization
 
@@ -328,7 +334,7 @@ if that doesn't produce a completion match."
     (setq-local icomplete-tidy-shadowed-file-names t
                 icomplete-show-matches-on-no-input t
                 icomplete-hide-common-prefix nil
-                completion-styles '(flex)
+                completion-styles fido-completion-styles
                 completion-flex-nospace nil
                 completion-category-defaults nil)))
 
-- 
2.26.0


[-- Attachment #2.3: Type: text/html, Size: 226 bytes --]

             reply	other threads:[~2020-05-31 21:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-31 21:02 Andrew Schwartzmeyer [this message]
2020-05-31 23:43 ` Add user customization fido-completion-styles 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
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=CE231FAF-4C52-4680-A2F2-0F33D140D242@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).