From: Alan Mackenzie <acm@muc.de>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: emacs-devel@gnu.org
Subject: Re: Fixing ill-conditioned regular expressions. Proof of concept.
Date: Wed, 25 Feb 2015 10:08:34 +0000 [thread overview]
Message-ID: <20150225100834.GA3502@acm.fritz.box> (raw)
In-Reply-To: <54EBB9C4.1020505@cs.ucla.edu>
Hi, Paul.
On Mon, Feb 23, 2015 at 03:37:40PM -0800, Paul Eggert wrote:
> Alan Mackenzie wrote:
> > Why not call fix-re from within
> > re-search-forward/backward, looking-at, ...
> I was thinking of calling it from within regexp.c itself, so that the
> callers would not need to be changed; it's the same basic idea, just a
> bit easier on the maintainers.
regexp.c is a "pure" sort of module, not even containing the cache for
the compiled regexps, so that doesn't seem the place for fix-re.el.
Thinking about it, calling fix-re for every regexp search doesn't seem
right. Most regexps are perfectly blameless, and filling up the fix-re
cache with them is a waste of time. More to the point, it is sometimes
not possible to preserve the numbering of \(...\) constructs while
fixing a regexp, which would change the match-data. But in the context
where one wants to call fix-re, mainly regexps constructed from
user/package configuration variables, the \(...\) numbers aren't
significant anyway.
So, how about the following: a new variable isearch-fix-re-flag which
would have to be bound to non-nil for fix-re to run, then binding this
variable in the few places it's needed, such as in forward-paragraph.
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2015-02-25 10:08 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-23 18:12 Fixing ill-conditioned regular expressions. Proof of concept Alan Mackenzie
2015-02-23 19:55 ` Paul Eggert
2015-02-23 20:21 ` Alan Mackenzie
2015-02-23 22:19 ` Paul Eggert
2015-02-23 22:42 ` Alan Mackenzie
2015-02-23 23:07 ` Artur Malabarba
2015-02-23 23:37 ` Paul Eggert
2015-02-25 10:08 ` Alan Mackenzie [this message]
2015-02-26 1:11 ` Stephen J. Turnbull
2015-02-26 8:46 ` Paul Eggert
2015-02-26 10:11 ` Alan Mackenzie
2015-02-26 11:05 ` Tassilo Horn
2015-02-26 13:09 ` Alan Mackenzie
2015-02-26 13:46 ` Stefan Monnier
2015-02-26 16:21 ` Alan Mackenzie
2015-02-26 19:12 ` Stefan Monnier
2015-02-26 20:01 ` Alan Mackenzie
2015-02-27 13:45 ` Stefan Monnier
2015-02-24 16:29 ` Stefan Monnier
2015-02-24 6:20 ` Philipp Stephani
2015-03-13 22:53 ` Stefan Monnier
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150225100834.GA3502@acm.fritz.box \
--to=acm@muc.de \
--cc=eggert@cs.ucla.edu \
--cc=emacs-devel@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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.