unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Hongyi Zhao <hongyi.zhao@gmail.com>
To: Tassilo Horn <tsdh@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Use Vertico + consult to do the search for an exact word.
Date: Fri, 2 Jun 2023 09:53:11 +0800	[thread overview]
Message-ID: <CAGP6PO+Vfoqm9SCRBzp63onJkC+Jvu=NHNDnQaab4=esKf7DZw@mail.gmail.com> (raw)
In-Reply-To: <87zg5jj9l7.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 2364 bytes --]

On Fri, Jun 2, 2023 at 2:56 AM Tassilo Horn <tsdh@gnu.org> wrote:
>
> 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.

See below:

;;; output begin here
             position: 14582 of 24975 (58%), column: 6
            character: $ (displayed as $) (codepoint 36, #o44, #x24)
              charset: ascii (ASCII (ISO646 IRV))
code point in charset: 0x24
               script: latin
               syntax: $     which means: math
             category: .:Base, a:ASCII, l:Latin, r:Roman
             to input: type "C-x 8 RET 24" or "C-x 8 RET DOLLAR SIGN"
          buffer code: #x24
            file code: #x24 (encoded by coding system utf-8-unix)
              display: by this font (glyph code):
    ftcrhb:-PfEd-DejaVuSansMono Nerd Font
Mono-regular-normal-normal-*-20-*-*-*-m-0-iso10646-1 (#x07)

Character code properties: customize what to show
  name: DOLLAR SIGN
  general-category: Sc (Symbol, Currency)
  decomposition: (36) ('$')

There are text properties here:
  face                 font-latex-math-face
  fontified            t
  wrap-prefix          " "
;;; output end here

> 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.

This method works, as shown in the attached screenshot.

> Bye,
> Tassilo

Regards,
Zhao

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 53660 bytes --]

      reply	other threads:[~2023-06-02  1:53 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
2023-06-02  1:53           ` Hongyi Zhao [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CAGP6PO+Vfoqm9SCRBzp63onJkC+Jvu=NHNDnQaab4=esKf7DZw@mail.gmail.com' \
    --to=hongyi.zhao@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=tsdh@gnu.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).