[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: modern regexes in emacs
From: |
Lars Ingebrigtsen |
Subject: |
Re: modern regexes in emacs |
Date: |
Mon, 25 Feb 2019 15:47:49 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Richard Stallman <address@hidden> writes:
> That's true, of course. But I wonder if some other interface could
> make it possible to offer optional use of egrep syntax in a compatible
> way that would not break anything.
I have not followed this discussion closely, so I'm sorry if I'm
repeating points others have made before, but:
I think it would be nice if Emacs had a regexp object. That would allow
us to extend Emacs in a compatible way somewhat seamlessly over a period
of time.
We could have a number of different functions that use different regexp
syntaxes, but they'd all return a regexp object.
For instance, we could have (erx "foo\\|bar") and (pcre "foo|bar") etc,
and this would allow us to experiment with different syntaxes more
freely.
The base Emacs functions that do stuff on regexps have to be adjusted en
masse, probably, but there aren't thousands of them --
`re-search-forward' etc -- to take these objects in addition to strings.
And: The final endpoint (many years in the future) of all this would be
to deprecate the `re-' functions altogether, and allow functions like
`search-forward' to take either a string or a regexp object and behave
in the obvious fashion...
(search-forward (pcre "foo|bar"))
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
- Re: modern regexes in emacs, (continued)
- Re: modern regexes in emacs, Alan Mackenzie, 2019/02/15
- RE: modern regexes in emacs, Drew Adams, 2019/02/15
- Re: modern regexes in emacs, Perry E. Metzger, 2019/02/15
- Re: modern regexes in emacs, Jay Kamat, 2019/02/15
- Re: modern regexes in emacs, Perry E. Metzger, 2019/02/15
- Re: modern regexes in emacs, Jay Kamat, 2019/02/15
- Re: modern regexes in emacs, Eli Zaretskii, 2019/02/15
- Re: modern regexes in emacs, Mattias Engdegård, 2019/02/15
- Re: modern regexes in emacs, Eli Zaretskii, 2019/02/15
- Re: modern regexes in emacs, Richard Stallman, 2019/02/16
- Re: modern regexes in emacs,
Lars Ingebrigtsen <=
- Re: modern regexes in emacs, Clément Pit-Claudel, 2019/02/25
- Re: modern regexes in emacs, Richard Stallman, 2019/02/25
- Re: modern regexes in emacs, Lars Ingebrigtsen, 2019/02/26
- Re: modern regexes in emacs, Troy Hinckley, 2019/02/26
- Re: modern regexes in emacs, Lars Ingebrigtsen, 2019/02/26
- Re: modern regexes in emacs, Andreas Schwab, 2019/02/26
- Re: modern regexes in emacs, Mattias Engdegård, 2019/02/27
- Re: modern regexes in emacs, Daniel Pittman, 2019/02/27
- Re: modern regexes in emacs, Eli Zaretskii, 2019/02/26
- Re: modern regexes in emacs, Richard Stallman, 2019/02/26