help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Use Vertico + consult to do the search for an exact word.


From: Tassilo Horn
Subject: Re: Use Vertico + consult to do the search for an exact word.
Date: Thu, 01 Jun 2023 20:45:12 +0200
User-agent: mu4e 1.11.6; emacs 30.0.50

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 via email to

[Prev in Thread] Current Thread [Next in Thread]