From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Re: "Raw" string literals for elisp Date: Thu, 9 Sep 2021 15:33:44 +0200 Message-ID: <77353F5F-DCA0-4070-8DD8-CD0F80216378@acm.org> References: <4209edd83cfee7c84b2d75ebfcd38784fa21b23c.camel@crossproduct.net> <20210908160531.GA18656@tuxteam.de> <0E3E472D-0F65-45B8-BE70-118F88AAD29C@acm.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10442"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Anna Glasgall , Stefan Monnier , Emacs developers To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Sep 09 15:34:51 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mOKCZ-0002U6-Al for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Sep 2021 15:34:51 +0200 Original-Received: from localhost ([::1]:50530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mOKCX-0001W6-Jm for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Sep 2021 09:34:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45312) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mOKBl-00005p-7i for emacs-devel@gnu.org; Thu, 09 Sep 2021 09:34:01 -0400 Original-Received: from mail1459c50.megamailservers.eu ([91.136.14.59]:52730 helo=mail267c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mOKBg-0001ev-Em for emacs-devel@gnu.org; Thu, 09 Sep 2021 09:34:00 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1631194428; bh=+/W/ROH6MkU8wVSllXSGdEuTCv/DGx0m4glVfT67zUo=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=KYmYtDz8yJWr92iToAMTF051f9MbM5bJliUUOfFGFCmr0H3rH7MiGr1YsZnYd9oKo 3tb9Mqqzh21EmxiANLfa7Neb2cqJn92rww+yRgkthYSIu3mmDVVq9GXm6aYJNzdeDG F2lB3rxoWnTRfDpU9pubu2UywIhdC9Vpjjf00MVQ= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.0.4] (c188-150-171-71.bredband.tele2.se [188.150.171.71]) (authenticated bits=0) by mail267c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 189DXipE014396; Thu, 9 Sep 2021 13:33:46 +0000 In-Reply-To: X-Mailer: Apple Mail (2.3445.104.21) X-CTCH-RefID: str=0001.0A742F21.613A0D3C.007D, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.4 cv=Zf5+iuZA c=1 sm=1 tr=0 ts=613a0d3c a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=El-VxsduhOc6odF8wx4A:9 a=CjuIK1q_8ugA:10 X-Origin-Country: SE Received-SPF: softfail client-ip=91.136.14.59; envelope-from=mattiase@acm.org; helo=mail267c50.megamailservers.eu X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:274446 Archived-At: 9 sep. 2021 kl. 13.36 skrev Stefan Kangas : >> I've used both Perl's /x and Python's re.X in raw triple-quoted = strings extensively, and they are nowhere as nice as rx. >=20 > Agreed. I mostly only pointed out that it exists for completion. Yes, sorry -- it wasn't meant as a rebuttal to what you wrote. It's also likely that regexps in the suggested "raw" string literals = would be inferior to what Python and Perl offer for reasons Stefan = Monnier already mentioned. The basic string regexp syntax would need a = complete change to even come close -- and then we have two slightly = different string regexp notations. Anna, I'm ashamed for welcoming a new friendly contributor as Mr. No. In = a weak attempt to compensate, here are some related areas in Emacs that = might benefit from your energy and skill: * [Easy] There is currently no build-in way to print the string " = \t\r\n" exactly that way -- the best we can do (setting = print-escape-newlines and print-escape-control-characters) is " = \11\15\n" which isn't as readable. Introduce an option to the Lisp = string printer so that common control characters print as their special = backslash sequences: \t, \r, \b, \e, maybe \a and \e, maybe not \v. * Improve interactive regexp use. Maybe a user could configure a = preferred regexp syntax (standard Emacs, PCRE, rx, etc) to be used when = doing interactive search and replace. It would also affect how regexps = are displayed and edited in customisation dialogues; right now, they are = often difficult to read. Ideally a user should be able to switch syntax = during entry at any time and have the regexp translated. Can syntax = colouring (font-lock) improve regexp entry and display? I'm sure other people have more suggestions (and I have some more = demanding items should you wish for something chewy.)