From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: Incrementally display the Emacs command list filtered out by the input key words in real-time. Date: Fri, 2 Jul 2021 23:27:47 +0800 Message-ID: References: <83mtr5jkpb.fsf@gnu.org> <87mtr4j2uf.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18979"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs To: Tassilo Horn Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 02 17:28:47 2021 Return-path: Envelope-to: geh-help-gnu-emacs@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 1lzL5z-0004jM-E6 for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 02 Jul 2021 17:28:47 +0200 Original-Received: from localhost ([::1]:40510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lzL5y-0005RU-G4 for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 02 Jul 2021 11:28:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lzL5H-0005PN-Bm for help-gnu-emacs@gnu.org; Fri, 02 Jul 2021 11:28:03 -0400 Original-Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]:43979) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lzL5F-0003Sq-K3; Fri, 02 Jul 2021 11:28:03 -0400 Original-Received: by mail-lj1-x229.google.com with SMTP id l18so258510ljb.10; Fri, 02 Jul 2021 08:28:00 -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 :cc; bh=6BKUw6OQUr5AyZxoyBNMEVwTTVWAl+cjg4sAyV/z5Kw=; b=Dcu3bCJZlNv42XmKdV/2Hkl8qTRgMA4hmnbAENx0Ms1+NjDf4SgBSbXLmZ6GZsgVnr wIrCfVnXHY82pHVqCGmGQg14b5+2c+oVKkVMyj5vS7kPL1Tb8lhdB2wvf+/qAT+qUlY+ WsGJPDR6NXsRM+pCZi9BzO8ad/29ICax5Fi2OZPEvtXzIjYnZ8PasHgJ5Grw4FdKY0b2 JBv3DX8OC75Pl0qTPONVufDEimhaQzwBwAk+mzUaNxeE/IsLjEhOvjiMpYr0aD7BK5T9 y5rdU0rArTxHiciLDXUPAAhPvqdfS02WIvIte7k4ACgb2E+4QLEozMcongKAXm2Tr5Xw sL+Q== 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:cc; bh=6BKUw6OQUr5AyZxoyBNMEVwTTVWAl+cjg4sAyV/z5Kw=; b=ZFCiNA4N8QnLxLSbw1FvEWLq/2rJN472Kx8+1tXUNqWsFzE0ZQCKzz8uKm3arxxSIX PtSP+bV2jEDIHAOeJnNVRgWbNP5H+om3yIVzEEpiyD4DPEWuL0Uu3Sp47qy2plB8HuU7 geLQ3lDCwohro4Pois4IgYkU8EucS5hcWtR70f1dBfqKeUYbXYzQwsg+EPhiscs3pGCp O4VFpzLAVavoV9j1CEYkUPSgGZGw4T7JEiNdTVvSxv9sg3lbohEvZlkym8Bakhbt+pWN GWv6SZlRtnDAiJ/7Cvhfv+BmoTMa8nmHaMA/saIFjiMQueSjOHpDkz3yzWCrIe6NhIGO g5Qw== X-Gm-Message-State: AOAM5329d7xsgcxBbIMXigCf+s32KoGAm5cUJNIWZ/iU0OQit3JU0bfe KqgRfYBIDZ5A9/BWJCgtOXI1YybnwCbzDCoxp1UxxCwdJlz7DijMbbU= X-Google-Smtp-Source: ABdhPJyCYS6PpZQuZFoQZWl4poTWF9RsOQPC+X5XdwsOl8gjKDQKkWAslViiiv/cupHECh7hlIy2WGzaSBQLRsBlrOA= X-Received: by 2002:a2e:bba0:: with SMTP id y32mr19500lje.287.1625239679090; Fri, 02 Jul 2021 08:27:59 -0700 (PDT) In-Reply-To: <87mtr4j2uf.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::229; envelope-from=hongyi.zhao@gmail.com; helo=mail-lj1-x229.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:131401 Archived-At: On Fri, Jul 2, 2021 at 8:51 PM Tassilo Horn wrote: > > Hongyi Zhao writes: > > > I tried the following code snippet posted at > > , > > but there is no effect at all: > > Emacs already has a fuzzy completion style (see the `flex' entry in > `completion-styles-alist'), no need to copy&paste some 6 year old > implementation from the internet. > > > (add-to-list 'completion-styles-alist > > '(naive-fuzzy > > completion-naive-fuzzy-try-completion > > completion-naive-fuzzy-all-completions > > "Simple naive-fuzzy completion, which never alters the > > string to complete, unless a unique match exists.")) > > > > ;; (setq-local completion-styles '(naive-fuzzy)) > > Try (setq completion-styles '(flex)). But note that the used > `completion-styles' just defines how the input is matched against the > things to be completed, i.e., you'll see no visual difference. See the > manual at (info "(emacs) Completion Styles"). > > To have a more visual UI, follow Eli's advice: > > >> And maybe try an alternative completion mode, like icompletion-mode. > > It is called `icomplete-mode'. > > Another very nice UI is the `vertico' package from GNU ELPA. Other > popular choices include ivy, selectrum, etc. Thank you very much for providing me with all kinds of information on the packages which can achieve this aim. Based on my tries, it seems that the ivy package, , is one of the most powerful one for this purpose. And the following simple configuration can achieve the effect described here: ;;; (straight-use-package `(swiper :type git :host github :repo "abo-abo/swiper" :pre-build ( ;("bash" "-c" "cd ~/.emacs.d/straight/repos/swiper") ;https://github.com/abo-abo/swiper/issues/2886#issuecomment-860605327 ("make" "deps") ("make" "compile") ))) (require 'ivy) (ivy-mode 1) (setq ivy-use-virtual-buffers t) (setq ivy-count-format "(%d/%d) ") ;;; HY -- Assoc. Prof. Hongyi Zhao Theory and Simulation of Materials Hebei Vocational University of Technology and Engineering NO. 552 North Gangtie Road, Xingtai, China