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: [External] : Incrementally display the Emacs command list filtered out by the input key words in real-time. Date: Fri, 2 Jul 2021 23:40:03 +0800 Message-ID: References: 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="38597"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 02 17:40:56 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 1lzLHj-0009pR-VE for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 02 Jul 2021 17:40:56 +0200 Original-Received: from localhost ([::1]:50098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lzLHi-000444-HO for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 02 Jul 2021 11:40:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lzLH9-00043t-7a for help-gnu-emacs@gnu.org; Fri, 02 Jul 2021 11:40:19 -0400 Original-Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]:35727) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lzLH6-0001No-Sw for help-gnu-emacs@gnu.org; Fri, 02 Jul 2021 11:40:18 -0400 Original-Received: by mail-lf1-x133.google.com with SMTP id r26so1349457lfp.2 for ; Fri, 02 Jul 2021 08:40:16 -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=u4RVG0iUILGXbtZqhh0WlFKn46meYzIm3HU+A7VnowI=; b=Q15yMm6X+wdzx8pdwPSv0TAR771tlLT4fF6XGOG+EGn1ZGTcGoXNyFUM8uYvaHpbpY RQ/sdXszSRdbTiBNkbaEpViiVD1syOtQppSafow4QC+L0iwfW830E6tfMk9ddo2sBUtf VKU51w0NWk52Ug0mhFylm0uoRe1b5QLyEkIP/xpGY/Zb2M/DpGvAYSu9AGIKZQ58PyfR Ac3kqKPzxmuDfn6QzkKFnc/lj5L8qtl9fEhHXRE3spFV6HaMaRW/uacy3+U23NxXHHMt rMTE2/3tPHxFYmS0NLUFPET30aHBKbVWmVomM+2XO6gehbdrBOWeGvnQV2hjbh9WdFOc y8+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=u4RVG0iUILGXbtZqhh0WlFKn46meYzIm3HU+A7VnowI=; b=SMG415cYfvuAo19JHJlop/CcgmPBklMK9eB29GJHLaPLNNCqtZ8G2/dhnxQgTU6AIN Fcg8TnaNfy8aa2peV4sKjJHPezBxUzl9bntuUqWGfFql41GiPapT3Fz17hXV2SUStT2u va7xw35rP2b9cLTzFJn3cucaa/IDGnztBEXssV8dNeP9lDIMz3aoxrz7xiNZosHpbkex qXKQXjad8jfodoTvqLi9JbUntmcZ00xwEzrkz0mY236x/QRjm7BTF+SlX0W2gEUv0iW4 OU4q/t5wu2GgBxvAJbvkz9H4RP8THsYkt8d+ad7pxw55OT5aLcgOk7vV7OFkJfi22/MT SLYg== X-Gm-Message-State: AOAM531pvC6qrmb97uXlejSGlfxZd76BeRmI1CAafFmB3IQGw7xzjIm3 ZlEbd9mfZVQk4Potb8e1Qxzs2U34A/UJohhLxe4= X-Google-Smtp-Source: ABdhPJxeMhYxAlkPwEwNVQpe6D0XufDvKiuttb0o5QCIuSkZPafyGx+lcwG0wGr5BHrJvp64thaPmj83SAsPGrh0Kpk= X-Received: by 2002:a05:6512:2291:: with SMTP id f17mr191939lfu.466.1625240414926; Fri, 02 Jul 2021 08:40:14 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=hongyi.zhao@gmail.com; helo=mail-lf1-x133.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:131403 Archived-At: On Fri, Jul 2, 2021 at 10:43 PM Drew Adams wrote: > > > Say, when I input "foo bar", the matched command > > list are incrementally displayed immediately, and > > finally the ones which including "foo" and "bar" > > in any part of the candidate commands are filtered > > out. How do I configure my init file to implement > > this feature? > > Not too sure what you're asking for. > > 1. You say you want to first see command-name > matches for input `foo bar'. > 2. But then you say you want command names that > contain either `foo' or `bar' to be filtered > out (i.e., excluded). > Sorry for my misleading/erroneous description. I mean 1. above-mentioned by you. > Those two seem contradictory. The first seems > unnecessary - undone by the second. But maybe > you just want to see all command names at first, > for some reason. > > Anyway, if what you want is instead something > like this: > > 1. You see all command names initially. > 2. You type something to exclude the names that > contain either `foo' or `bar'. > > Then that's trivial if you use Icicles. > > 1. To see all completions initially, set or bind > variable `icicle-show-Completions-initially-flag' > to non-nil. > > 2. To exclude matches of some pattern (e.g. `foo'): > > a. Type the pattern, to see _only_ its matches. > b. Use `C-~' to get the complement, i.e., to > subtract those matches from the previous set > of matches. > > E.g., to exclude all matches for `foo' or `bar' > (anywhere in the command name, i.e., in any order): > > 1. Type `foo C-~' to see all except `foo' matches. > 2. Type `bar C-~' to see all except matches for > `foo' or `bar'. > > See also: > > * https://www.emacswiki.org/emacs/Icicles_-_Nutshell_View#ChippingAway > > * https://www.emacswiki.org/emacs/Icicles_-_Candidate_Sets#SetOperations > > If you don't really care to show all completions for > empty input (e.g. all command names), then leave > `icicle-show-Completions-initially-flag' nil. > > By default, you can just use `TAB' or `S-TAB' to > initiate completion. Doing that once suffices: > completions are then updated automatically as you > change your minibuffer input. > > If you want completions to be updated automatically > whenever you change minibuffer input without having > to use `TAB' or `S-TAB', but you don't want to show > completions initially (i.e., with empty input), then > set variable `icicle-incremental-completion' to > non-nil and non-t (the default value is `t'). > > [You can cycle its value any time, using `C-#' during > completion: OFF, ON (initiated by `TAB' or `S-TAB'), > or eager (initiated by typing anything).] > > See: https://www.emacswiki.org/emacs/Icicles_-_Icompletion#IncrementalCompletion > > ___ > > There is, BTW, no "fuzzy" matching involved in > your example of excluding `foo' and `bar' matches. > However, Icicles does support fuzzy matching - > seven kinds of fuzzy matching, in fact. > > See https://www.emacswiki.org/emacs/Icicles_-_Completion_Methods_and_Styles#FuzzyCompletion Thank you again for letting me know there are so many choices to achieve this aim. Based on another hint/suggestion given by Tassilo Horn , I'm currently using the following settings to obtain this effect: ;;; (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) ") ;;; Regards -- Assoc. Prof. Hongyi Zhao Theory and Simulation of Materials Hebei Vocational University of Technology and Engineering NO. 552 North Gangtie Road, Xingtai, China