all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: Hongyi Zhao <hongyi.zhao@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Use Vertico + consult to do the search for an exact word.
Date: Thu, 01 Jun 2023 20:45:12 +0200	[thread overview]
Message-ID: <87zg5jj9l7.fsf@gnu.org> (raw)
In-Reply-To: <CAGP6PO+uGQrhJOy_g4ABEmrSaSoVd_VkoeoQLu2XYsoeeWA14Q@mail.gmail.com>

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

>> That's because $ is a word-character in the syntax-table of the mode
>> you are using in that buffer.  You can try
>> \([^a-zA-Z]\|\b\)id\([^a-zA-Z]\|\b\) which should also find $id$ and
>> 1id02.
>
> Yes. This works, as shown in the attached screenshot. But the input is
> rather cumbersome. Are there more efficient/concise regexp patterns
> for this goal?

Well, \bid\b should be enough, actually.  I don't understand why it
seems like the $s in $id$ in your latex buffer have word syntax.  I've
just tried both the stock latex-mode and AUCTeX and with both the $s
don't have word syntax.

Could you please put point on such a $ and report the output of M-x
describe-char RET?  I'm mostly interested in the line

  syntax: $ 	which means: math

which might be

  syntax: w 	which means: word

on your side for whatever reason.

Also, please try if regexp isearch works as expected, i.e., C-u C-s
\bid\b should also find the id in $id$.  If you both have $ in math
syntax and isearch works but consult doesn't, then I'd ask at the
consult community.

Bye,
Tassilo



  reply	other threads:[~2023-06-01 18:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31 23:27 Use Vertico + consult to do the search for an exact word Hongyi Zhao
2023-06-01  6:50 ` Tassilo Horn
2023-06-01  7:36   ` Hongyi Zhao
2023-06-01  9:47     ` Tassilo Horn
2023-06-01  9:59       ` Hongyi Zhao
2023-06-01 18:45         ` Tassilo Horn [this message]
2023-06-02  1:53           ` Hongyi Zhao

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zg5jj9l7.fsf@gnu.org \
    --to=tsdh@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    --cc=hongyi.zhao@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.