From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: Use Vertico + consult to do the search for an exact word. Date: Thu, 01 Jun 2023 08:50:28 +0200 Message-ID: <87zg5jsmez.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12332"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.11.6; emacs 30.0.50 Cc: help-gnu-emacs@gnu.org To: Hongyi Zhao Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 01 08:54:44 2023 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 1q4cCp-0002vs-QO for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 01 Jun 2023 08:54:43 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4cCE-00014O-Aa; Thu, 01 Jun 2023 02:54:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4cCB-00014E-IG for help-gnu-emacs@gnu.org; Thu, 01 Jun 2023 02:54:03 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4cCB-0008Ti-51; Thu, 01 Jun 2023 02:54:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-reply-to:Date:Subject:To:From: References; bh=jAS+Xr3KTO3GJe3sTZFSNCziz4lgdHwNa+YdPAxTNCE=; b=Gpfv6GKX9vqdjN pf25JLCGy0KEb1ZjvI3Pe2L/B3bT7d0KvldeAq8iu8Bg1JBhlXSQhN5m1jb1edk8A+S5YgPRg4DVX 474viJDZxoMMpx14L5jEoZ9bgI+wPLPmxiRW2K2gMcpWaRbu+SAFTJvFnYAmOWVikfVmVDzKv/hVd aArcqJSMM5MyP/7Xzt2dfUkjFgHZCr79YsSuIrlSMTcLSFTQpJvHUFXAhWWp5xn32HyczpKKTaGa/ GZev+LebSahH7zYUE5NbghAyY9TnX4ebiNoBZCKtlKdBm02o8rJgOneH9JbCFBaXFAusAKd1rObZF g9FVn8fTpluuxaVxPhTQ==; Original-Received: from auth2-smtp.messagingengine.com ([66.111.4.228]) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q4cC9-0002o6-66; Thu, 01 Jun 2023 02:54:02 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id A992027C0054; Thu, 1 Jun 2023 02:54:00 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 01 Jun 2023 02:54:00 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeltddgudduhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpehffgfhvfevufffjgfkgggtgfesthhqredttderjeenucfhrhhomhepvfgr shhsihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucggtffrrghtthgvrh hnpefgtedtudeivdfhfffhfefhvefhuedvheejjeefleffheekffeutdfhgfejiefhgeen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhorh hnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdekieejfeekjeekgedqieef hedvleekqdhtshguhheppehgnhhurdhorhhgsehfrghsthhmrghilhdrfhhm X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 1 Jun 2023 02:53:58 -0400 (EDT) In-reply-to: X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:143821 Archived-At: Hongyi Zhao writes: > In Emacs, I use Vertico + consult to do the in-buffer and minibuffer > search and bind bound the command `consult-line' to M-s l. > > What puzzles me is that this cannot let me search for an exact word. > For example, if I want to sear all the occurrences of the word `id', > the result obtained is shown in the attached file, which obviously is > not what I want. > > How to achieve my goal based on Vertico + consult for utilizing the > more intuitive minibuffer display? I don't use consult myself but I guess the search string is a regular expression. So when you want to search for an exact word, use \bid\b to find all occurrences of the word id. See (info "(elisp) Regexp Backslash") for details: --8<---------------cut here---------------start------------->8--- =E2=80=98\b=E2=80=99 matches the empty string, but only at the beginning or end of a word. Thus, =E2=80=98\bfoo\b=E2=80=99 matches any occurrence of =E2= =80=98foo=E2=80=99 as a separate word. =E2=80=98\bballs?\b=E2=80=99 matches =E2=80=98ball=E2= =80=99 or =E2=80=98balls=E2=80=99 as a separate word. =E2=80=98\b=E2=80=99 matches at the beginning or end of the buffer (or= string) regardless of what text appears next to it. --8<---------------cut here---------------end--------------->8--- HTH, Tassilo