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

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

Re: [External] : Re: Regexp for matching control character, say, FORM FE


From: Hongyi Zhao
Subject: Re: [External] : Re: Regexp for matching control character, say, FORM FEED. (Was: Re: The `^L' appeared in built-in help.)
Date: Thu, 22 Jul 2021 21:56:09 +0800

On Thu, Jul 22, 2021 at 12:14 PM Emanuel Berg via Users list for the
GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
>
> Drew Adams wrote:
>
> >>>>> I want to know whether there are some similar regexp
> >>>>> patterns in Emacs as the ones used by grep, say, $'\014'
> >>>>> or $'\f'.
> >>>>
> >>>> (re-search-forward "\C-l")
> >>>
> >>> Yes, or (re-search-forward "[\f]")
> >>>      or (re-search-forward "[\014]")
> >>
> >> What about
> >>
> >>   (re-search-forward (kbd "C-l"))
> >
> > Sure.  Which is the same as (re-search-forward "\f").
>
> So far, these works
>
>   (re-search-forward "[\014]")
>   (re-search-forward "[\f]")
>   (re-search-forward "\C-l")
>   (re-search-forward "\f")
>   (re-search-forward (kbd "C-l"))
>
> It seems subexpressions at lines 1 and 2 evaluate to the same
> "[^L]", as does for their part lines 3, 4 and 5, and then it
> is "^L"...

I observed another strange phenomenon as described below.

Suppose I've the following content in scratch buffer:

(re-search-forward "\f")
^L

I put the point at the end of sexp line, and hit `C-j' to evaluate it.
I find that each time after the sexp has been evaluated successfully,
the `^L' line will be moved to the next line. See the screenshot in
the attachment, where I've evaluated the sexp 4 times.

Any hints for this behavior?

Regards,
HY

Attachment: 2021-07-22_21-55.png
Description: PNG image


reply via email to

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