From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dima Kogan Newsgroups: gmane.emacs.devel Subject: Re: Embedded modifiers in the regex engine Date: Fri, 22 Apr 2016 22:17:08 -0600 Message-ID: <87r3dxari3.fsf@secretsauce.net> References: <87ziupinhq.fsf@secretsauce.net> <83oab4g407.fsf@gnu.org> <83mvqnet3t.fsf@gnu.org> <87wpppioxi.fsf@secretsauce.net> <83povgakpy.fsf@gnu.org> <871t6v1mdb.fsf@secretsauce.net> <83oa9yy643.fsf@gnu.org> <87vb46zdf5.fsf@secretsauce.net> <834mbqxxxx.fsf@gnu.org> <87lh51yo5c.fsf@secretsauce.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1461385057 20810 80.91.229.3 (23 Apr 2016 04:17:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Apr 2016 04:17:37 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Dima Kogan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 23 06:17:26 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1atp0W-0004nx-FF for ged-emacs-devel@m.gmane.org; Sat, 23 Apr 2016 06:17:24 +0200 Original-Received: from localhost ([::1]:45429 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atp0V-0003Wb-Rw for ged-emacs-devel@m.gmane.org; Sat, 23 Apr 2016 00:17:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atp0O-0003Sl-Hw for emacs-devel@gnu.org; Sat, 23 Apr 2016 00:17:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1atp0L-0003QY-BN for emacs-devel@gnu.org; Sat, 23 Apr 2016 00:17:16 -0400 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:39662) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1atp0L-0003QQ-7x for emacs-devel@gnu.org; Sat, 23 Apr 2016 00:17:13 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id D98272620A for ; Sat, 23 Apr 2016 00:17:11 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 23 Apr 2016 00:17:11 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=ZIjyJ uJZXSg6THguWeWU3y5Me8k=; b=ZsrlZYRJ9oeDZq6iDH3lyZTUcaI0fKc46kfVl j2ta958dvFl5FfWK9ZKot3AjwM9gPzT9wBc38nc85AeXfn/S3kFZdALJeqaJBU7r 8G7G9it7WkodHhjxojieabRjnlfwqBMgVzB6xh35kqM3NtKv55OSj5WlE0kPTbEb y65fwk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=ZIjyJuJZXSg6THguWeWU3y5Me8k=; b=BiFXQ ys0W4Z1bVyIR/QqWrk8naoGsH4DVED6QIXgww3vQ50rhl+gaWoozBGPTEBuKd2B6 om8fnjGu6tsii6YrD7VuScitAu31Xv49G3FqfllyPHUMA8pM9hVeR2vmSmBoxzkB gewEVZM/rSXPGLATJw++aekZYXBfI2NpkN0LS4= X-Sasl-enc: Vr0GNzh3a2JzeQ7wXpXgeKRMSc98G1kJ5lneeUgu4P6F 1461385031 Original-Received: from shorty.local (174-28-69-50.albq.qwest.net [174.28.69.50]) by mail.messagingengine.com (Postfix) with ESMTPA id 6C9EDC00012; Sat, 23 Apr 2016 00:17:11 -0400 (EDT) Original-Received: from localhost ([::1] helo=shorty) by shorty.local with esmtp (Exim 4.84) (envelope-from ) id 1atp0H-0007TZ-05; Fri, 22 Apr 2016 22:17:09 -0600 User-agent: mu4e 0.9.17; emacs 25.0.92.1 In-reply-to: <87lh51yo5c.fsf@secretsauce.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.26 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:203198 Archived-At: Dima Kogan writes: > Eli Zaretskii 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