all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dima Kogan <lists@dima.secretsauce.net>
To: Dima Kogan <lists@dima.secretsauce.net>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: Embedded modifiers in the regex engine
Date: Fri, 22 Apr 2016 22:17:08 -0600	[thread overview]
Message-ID: <87r3dxari3.fsf@secretsauce.net> (raw)
In-Reply-To: <87lh51yo5c.fsf@secretsauce.net>

Dima Kogan <lists@dima.secretsauce.net> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>>> > What's wrong with the existing one?
>>> 
>>> Maybe nothing. I'd like to add a feature, but if there are plans to
>>> abandon the current implementation, then I want to add my feature to
>>> whatever the new implementation is.
>>
>> AFAIK, no one works on replacing the current implementation.  So we
>> should talk about the changes first, and worry about replacing the
>> current code later.
>
> OK. I'll go back to look at my earlier work to add the feature to the
> current implementation.

Sorry for the delay. An initial implementation of the case-fold embedded
modifiers lives at

  https://github.com/dkogan/emacs-snapshot/tree/regex_embedded_modifiers

That tree contains the implementation and the tests. This is not
intended to be a final implementation, but should be sufficient to get a
comment from the list. If this looks like something we're not going to
want to merge, I'd like to know before I put more work into it. Most
things should work as one would expect. Some fancier regexen probably do
not work yet; more tests should be written to test more cases. Maybe the
tests from the perl project should be imported into the suite in
addition to the glibc ones.

Clearly, this is not a small patch, but the test suite should hopefully
serve as some assurance that this doesn't break things (too badly).

The new code adds two patterns the regex engine understands:

   \(i\)   to turn on case-fold
   \(-i\)  to turn off case-fold

These are active until another such pattern is encountered, or until the
end of a () group. This is exactly how these work in perl. Before any of
these is encountered, the value of `case-fold-search' is used, so the
previous behavior should be preserved.

In the code, most functions previously accepted a `translate' argument
that was NULL to indicate that no case-fold is desired. This argument is
non-NULL in the new code, with an additional case-fold arg to indicate
the initial state.

The larger goal here, in my mind, is to add modifiers for all the
various switches that we have in isearch: lax-whitespace, char-fold,
symbol-search, word-search, etc. I can imagine this being useful for
various things, in particular making search histories work nicer, making
hi-lock simpler and so on.

Thanks



  parent reply	other threads:[~2016-04-23  4:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-25  1:32 Embedded modifiers in the regex engine Dima Kogan
2016-02-25  6:11 ` John Wiegley
2016-02-25 21:05   ` Stefan Monnier
2016-02-25 16:15 ` Eli Zaretskii
2016-02-26  7:19   ` Dima Kogan
2016-02-26  9:08     ` Eli Zaretskii
2016-02-28  1:50       ` Dima Kogan
2016-02-28 16:00         ` Eli Zaretskii
2016-02-29 13:30           ` Richard Stallman
2016-03-01  0:49             ` Aurélien Aptel
2016-03-01 16:55               ` Richard Stallman
2016-03-09  0:34                 ` Dima Kogan
2016-03-28  0:23                   ` Dima Kogan
2016-03-28 15:28                     ` Eli Zaretskii
2016-03-28 18:05                       ` Dima Kogan
2016-03-28 18:24                         ` Eli Zaretskii
2016-03-29 21:23                           ` Dima Kogan
2016-03-31 16:28                             ` Eli Zaretskii
2016-04-23  4:17                             ` Dima Kogan [this message]
2016-04-23  7:48                               ` Eli Zaretskii
2016-04-24  7:34                                 ` Dima Kogan
2016-03-28 16:09                     ` 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=87r3dxari3.fsf@secretsauce.net \
    --to=lists@dima.secretsauce.net \
    --cc=eliz@gnu.org \
    --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.