From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: using non-Emacs regexp syntax Date: Sun, 03 Dec 2006 22:22:41 +0200 Organization: JURTA Message-ID: <87d5703f1q.fsf@jurta.org> References: <58590.128.165.123.18.1165012500.squirrel@webmail.lanl.gov> <200612020054.12344.pogonyshev@gmx.net> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1165189995 23030 80.91.229.10 (3 Dec 2006 23:53:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 3 Dec 2006 23:53:15 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 04 00:53:09 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1Gr18s-0004Dg-KD for ged-emacs-devel@m.gmane.org; Mon, 04 Dec 2006 00:53:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gr18s-0002Pu-4Y for ged-emacs-devel@m.gmane.org; Sun, 03 Dec 2006 18:53:06 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gr18j-0002Pp-8j for emacs-devel@gnu.org; Sun, 03 Dec 2006 18:52:57 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gr18h-0002Pc-LN for emacs-devel@gnu.org; Sun, 03 Dec 2006 18:52:56 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gr18h-0002PZ-IV for emacs-devel@gnu.org; Sun, 03 Dec 2006 18:52:55 -0500 Original-Received: from [62.64.120.197] (helo=relay02.kiev.sovam.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1Gr18e-0008LB-EO; Sun, 03 Dec 2006 18:52:52 -0500 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay02.kiev.sovam.com with esmtp (Exim 4.60) (envelope-from ) id 1Gr18R-000Fad-Pd; Mon, 04 Dec 2006 01:52:48 +0200 Original-To: Paul Pogonyshev In-Reply-To: <200612020054.12344.pogonyshev@gmx.net> (Paul Pogonyshev's message of "Sat, 2 Dec 2006 00:54:12 +0200") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.90 (gnu/linux) X-Scanner-Signature: 367251710ae6d8069d2a2bb66b314d03 X-DrWeb-checked: yes X-SpamTest-Envelope-From: juri@jurta.org X-SpamTest-Group-ID: 00000000 X-SpamTest-Info: Profiles 559 [Dec 03 2006] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {received from trusted relay: not dialup} X-SpamTest-Method: none X-SpamTest-Method: Local Lists X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0255], KAS30/Release X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:63251 Archived-At: > * Each implemented format provides a table of associations > construct-name -> construct-generator (some constructs, like [] > character class, will require a parameter.) In the simplest form, > construct-generator can be just a fixed string, which will suffice in > most cases. > > * Each format also provides a parser that splits a regexp into a list > of construct-name. > > * Entry function (or a helper for it) combines together a table for > output format and a parser for input format. The result is a regexp > in output format. A good implementation would parse a regexp string to the sregex Lisp-like syntax (qv emacs-lisp/sregex.el) which would allow doing such things as (sregexq (a-new-function-to-parse-Perl-regexp PERL-REGEXP)) to convert a non-Emacs regexp to the Emacs one. PS: I would much prefer to use this feature in query-replace-regexp with an option to use extended regexps instead of basic regexps in its interactive arguments. -- Juri Linkov http://www.jurta.org/emacs/