From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: modern regexes in emacs Date: Fri, 15 Feb 2019 09:10:26 -0500 Message-ID: <387b4e87-2255-0467-c23e-e60c6b090fb3@gmail.com> References: <20180616123704.7123f6d7@jabberwock.cb.piermont.com> <87po0qs6re.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="148605"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 15 15:11:22 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gueD2-000cRJ-Ff for ged-emacs-devel@m.gmane.org; Fri, 15 Feb 2019 15:11:20 +0100 Original-Received: from localhost ([127.0.0.1]:40558 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gueD1-0001l8-8z for ged-emacs-devel@m.gmane.org; Fri, 15 Feb 2019 09:11:19 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55452) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gueCK-0001l2-8U for emacs-devel@gnu.org; Fri, 15 Feb 2019 09:10:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gueCG-0002g3-HY for emacs-devel@gnu.org; Fri, 15 Feb 2019 09:10:34 -0500 Original-Received: from mail-qt1-x82d.google.com ([2607:f8b0:4864:20::82d]:34055) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gueCE-0002cM-QP for emacs-devel@gnu.org; Fri, 15 Feb 2019 09:10:31 -0500 Original-Received: by mail-qt1-x82d.google.com with SMTP id w4so11019571qtc.1 for ; Fri, 15 Feb 2019 06:10:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=GYNFJvUisSY0H9nySUkaiJCuQ4Uxc8MJmSpF/L8ODZo=; b=tNQ7Lk96AiV12devBuT1xdmY8AqT3a+x0nqApDBNG3mSkl6q1UOoj/e1rK5BnZHJTS hywx6YNGxviwEqOpD/g9WR7PsOfJ++mx98whv1CNl3mbasJwBZS/BMRqe9Q5LnMpHbQ0 +gIuGLff734Kx890v3EcCaug/nWF2TPgGk2z7vd9kst+vAxERd/jGRxlrXMsunkjE5wO BA7mmdAmMaMXQe9q447vyohguFFNRMkaZSTOeTn2Yq0qLWjM6j43da/Bi0sw4vafpyS+ ljB2/iZLI8i/hKYlKDoT5ZvzQH2gtw9ADFw4XHOPrEnp78rTw9mabmkbdK7XQXwXd8UG M6iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=GYNFJvUisSY0H9nySUkaiJCuQ4Uxc8MJmSpF/L8ODZo=; b=mPrzFyVYc0ltSpXieMTGg4yABJ4laPhSUVfaU91kPzdS6Ecql7QQ1fBNxo1NvqpKmc 96FSF1jBj7qa7GAS5tOk/mwFtZLPZraLrCdOKfXVcdPUN65riESMVChGE7ZCN+nRLVTu gKuDcvuffeoO1toIGws+Y8Rdk/c+QmDk/9IawLwLP/r5Xpp6YHepUESCMaAtNocwYGeq Hbp7JL0dv6+ExiomPZ3nQd02ZYJ9uks+w4AGpvQxNx/HweUeOmNgoC9Z0yHM8XcboFID HBplkridajs/Y+xP7XhN/vGCOT8TqUfO2XcUtn49aSdkGtwTzHDdjXF9MKDJ37iDLMth b78g== X-Gm-Message-State: AHQUAuaitbryp4OcWMh0RLGaqa45UNiF0wiKGzlbJmk2psUXW/TVAEoY KPvAah/4SrUhTivkCS/vu+pSjt1i X-Google-Smtp-Source: AHgI3IbHR+e5t3/mk/MjHtWmz+IVcbORvnuJkY4+UK77KjvgWkAsOii8/yCGRmFS7OHGduWOQiQlTw== X-Received: by 2002:a0c:b626:: with SMTP id f38mr7373268qve.166.1550239828796; Fri, 15 Feb 2019 06:10:28 -0800 (PST) Original-Received: from ?IPv6:2601:184:4180:66e7:f0cc:8c46:f643:1be8? ([2601:184:4180:66e7:f0cc:8c46:f643:1be8]) by smtp.googlemail.com with ESMTPSA id r44sm3668323qtc.69.2019.02.15.06.10.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Feb 2019 06:10:28 -0800 (PST) In-Reply-To: Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::82d 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:233370 Archived-At: On 15/02/2019 08.42, Philippe Vaucher wrote: > Would this even be possible? I can imagine a whole lot of packages breaking if the regexp syntax changed, and changing it just for the user input in interactive functions looks a bit sketchy. We could just add a special tag at the beginning of a regexp to indicate that it's a pcre regexp; something like this maybe? (re-search-forward "\\(?pcre:\\)…[pcre regexp goes here]…"). This form is currently a syntax error, so there would be no ambiguity, and we could define a (pcre …) macro so that you could write (re-search-forward (pcre "…[pcre regexp goes here]…")) instead. Alternatively, we could use an explicit tag, something like (re-search-forward (cons 'pcre "…[pcre regexp goes here]…")). For interactive functions, I imagine you'd have a defcustom with a preferred regexp dialect.