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

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

Re: [External] : Re: Package cl is deprecated


From: Hongyi Zhao
Subject: Re: [External] : Re: Package cl is deprecated
Date: Sat, 31 Jul 2021 12:06:54 +0800

On Sat, Jul 31, 2021 at 9:34 AM Michael Heerdegen
<michael_heerdegen@web.de> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> > > (require[
> > >  ]+[.][
> > >  ]+cl)
> >
> > Thank you for showing me this pattern. TBF, it seems to me that the
> > syntax of line spanning match pattern is very strange. It would be
> > nice if there were some explanation for how to build this pattern.
>
> I suggest to use "xr" which is the reverse of `rx' which is a thing that
> allows to construct regular expressions from a simple and well
> documented symbolic description language (see doc of `rx').  So
>
> (xr "(require[
>  ]+[.][
>  ]+cl)")

I failed to expand the above lisp code snippet with macrostep [1]:

`M-x macrostep-expand RET':
macrostep-sexp-bounds: (xr ...) is not a macro form

Further, I tried with `C-h o ^xr$', and nothing is matched.

> ==>
>  (seq "(require"
>       (one-or-more (any "\n "))
>       "."
>       (one-or-more (any "\n "))
>       "cl)")
>
> As mentioned, see the help of `rx' to see what any part means, though
> it's already quite readable.
>
> Note that for regexp searching there is no Lisp interpreter involved
> that would read your input string.  What you type is used directly,
> which means that \n does not match a newline (but instead the character
> "n").  That's why the search pattern includes real newlines.  This is
> bit confusing at the beginning, anyway, that's already all, you can do
> it ;-)
>
>
> Michael.

[1] https://github.com/joddie/macrostep

Regards
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province



reply via email to

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