emacs-devel
[Top][All Lists]
Advanced

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

Re: modern regexes in emacs


From: Richard Stallman
Subject: Re: modern regexes in emacs
Date: Sat, 16 Feb 2019 22:17:37 -0500

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > > If I read the petitioners correctly, they want a global setting that
  > > permits them to type a(b|c) instead of a\(b\|c\) in
  > > isearch-forward-regexp and all other interactive commands.

  > That is not going to happen any time soon, because it will break gobs
  > of Emacs code.  I don't see anyone proposing that, because they all
  > understand the impossible implications.

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.

A text property on the string could specify this.  We could make a
convenient function to add that text property -- that's how users
would specify "new syntax".

  > If I read the petitioners correctly, they want a global setting
  > that permits them to type a(b|c) instead of a\(b\|c\) in
  > isearch-forward-regexp and all other interactive commands.

The incremental search commands are a separate issue -- having a flag
to control what syntax they use wouldn't break Lisp code.

If we create a new letter in interactive specs to read a regexp,
we could have a global variable specify that those should be
treated as "new syntax".  Arg reading would convert them to old syntax,
or add the text property; after that, they could be simply passed along.

-- 
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





reply via email to

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