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?Daniel_Mart=C3=ADn?= Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] A program to overlay Elisp regular expressions in rx form Date: Mon, 16 Nov 2020 20:20:44 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40028"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (darwin) Cc: emacs-devel@gnu.org To: =?utf-8?Q?Cl=C3=A9ment?= Pit-Claudel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Nov 16 20:30:14 2020 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 1kekCb-000AIk-Rk for ged-emacs-devel@m.gmane-mx.org; Mon, 16 Nov 2020 20:30:13 +0100 Original-Received: from localhost ([::1]:48532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kekCa-0004xD-Or for ged-emacs-devel@m.gmane-mx.org; Mon, 16 Nov 2020 14:30:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kek3e-0003IX-Tk for emacs-devel@gnu.org; Mon, 16 Nov 2020 14:20:58 -0500 Original-Received: from sonic310-11.consmr.mail.ir2.yahoo.com ([77.238.177.32]:43948) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kek3a-0005d3-Lg for emacs-devel@gnu.org; Mon, 16 Nov 2020 14:20:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1605554449; bh=gxVOhQm9b7b4nPH/NfcsLffcdfbKrYcWeqqZcwQgQOQ=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject; b=GRwjS9srydUYDN8hidQ8n0Mv0TKsYpEDGxd0FKMDKzCdeRp4IbbQkhzHKUV2iD+2l27DOK/h2IlEpHJMuFxyJWeddQr8anQVN5mgv6WdMl9RrbbgY02lD2jRxA0pyaouTYIWtZsMja0DQP49wO8W7k0ebMIs7XNLtGZ7ds2dwg4AbJGhvR/fhZbKbEgBMiQpYKJFiKyuPqL0QKeeYnKl/uyV5nQvCECu4qOdvMkpHPIHcjPotnagxL3nA3igC5ZFPLNDmJxz5eYhcwQj9A6oYq28Mw+wUAMQXRT4+4TXB8EG2fCmpVet96+/7PEO6uFBQOGxAMxfI0eGm3gW1lOLbg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1605554449; bh=SIj4zpOl7oBm+FYKI38LbRpL4WIxwlXomPl7eumYPwD=; h=From:To:Subject:Date:From:Subject; b=DH9/LYYCfepBXWHUP8cnx7WpZErrAtLh83Y0DxY1rn/MwymX2TeDGVYYKvx6epvJPGXp2UIAPCXqYQKGRhug4oWMFAn/Nd+5bURLr6AnbIiBBxPglQkJxDJvKm8tiHAbuPP/oVBbT+J8iuMdPl5XjAYP4TYIsBmPpO/Ea3F+JpxLFTFMhasivFIzub3hdB2Nlp6LrIp7rJBV0AtOJThLpcV4URK5+wsvZLYVzPeWd79zTSkPnavvMSmOqr9m/CptJjU/bz93eu5ojjGUMDeE218beDl7iCxt5gKe6gP+5eg2ZnoI1vQAQV2fNgmDKFd56Iyhxvut1QvbuXIjFl+3BA== X-YMail-OSG: HnhsShsVM1mlciB9beOA4jwhEaIUiEk3rBW6evpfZ1LzygB4lBZOcNQMykJYuRy ApcU3bGwRJjdNRTk8K1dto6GKHMGvLpsa18G7E..D0VyZJhqe7.DB2TtOXmRmLmC1dm59lT9KJNS lS5pFecJoWTYYvwRKMwqyucxPk4njnEJ8ECGd1oyr5KNyQFuu.3nU3UzpReIt1JC1vvd0Lc_nSSb kXN2osEh6jy1EWN6nwCedkzYpEejJTaj4WPzw3YwGFfmVV_y5Efg0bWjbmWuHhLVLnjRrlR_u7vm kZ8ZQL.Ajhc9mboR7epDy45WRTEAaBkcZ4mgosyZgBV4mwRfm5yAGlBirZcRPwmLVCb6qU9em6pt I6KWm7ulScvJx6ENVXUEPxpWMKqyx4U4RFbiLVvHbnXAa4eMYG3_9vOr3GyVY6kcTUoWQXcmaJzg Y.oyKfE6X7nge9G4PvbuVRtazI3duP.07Y3a9O9CC5vletXFwwqRaQI7Itz5sW2z6InpdHJOLZ.a dpr2oqAZm6NymTFfUweQ7ZHxh264Gdr6If83hKBzgOa3pa0bbLm20L.y0N4oS7SMBJAtlVMfqa0x 9xYUY3TJcFpfH15eoKL2kN35wQQi3Za9TJZHGjFIbIRBv2lHz6ZeFb3yqUbbN5BNAadlxK45I6SM z9k1SSUmt2g1Z8unC3YdmGlvbCvxKT2qI_voDPwo2nr_GGB3HY6Cl9mjREipr56fegYAQd2GIPKq UPfvwZU6A5jBugYCSWubazi7OOJYVequ7nLyC.q4H9iK1nfGEbKfB2bPjouaFw2DrPJ4wN_KBEYM kdLs1mhHgm8rBHMGilclSt9gefGsz2o6eekHlyGior Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.ir2.yahoo.com with HTTP; Mon, 16 Nov 2020 19:20:49 +0000 Original-Received: by smtp409.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 1d2d05a5911b1a6e0c8e9faff820f5c3; Mon, 16 Nov 2020 19:20:45 +0000 (UTC) In-Reply-To: (=?utf-8?Q?=22Cl=C3=A9ment?= Pit-Claudel"'s message of "Sun, 15 Nov 2020 09:03:51 -0500") X-Mailer: WebService/1.1.16944 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Apache-HttpAsyncClient/4.1.4 (Java/11.0.8) Received-SPF: pass client-ip=77.238.177.32; envelope-from=mardani29@yahoo.es; helo=sonic310-11.consmr.mail.ir2.yahoo.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/16 14:20:49 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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:259249 Archived-At: Cl=C3=A9ment Pit-Claudel writes: > On 11/15/20 6:16 AM, Daniel Mart=C3=ADn wrote: >> Is there general interest in this kind of functionality as a free >> program? I don't know if this could be a new feature of the xr package >> (most probably), or if it could be its own separate package. > This is very nice. I have a version of this in my local Emacs config, > but it's on by default and it doesn't put the buffer in read-only > more: it uses an overlay to display the rx regexp instead of the > string-based one instead. I've attached the code if you want to have > a look; what's missing is logic to automatically "unprettify" the > regexp when the point is in it, to make edits easy. > > I was originally planning to include this in the easy-escape package, but= I haven't found the time to do it, so feel free to go ahead :) > > Cl=C3=A9ment. Thanks for the link, your approach looks simpler, which is nice. As you said, the workflow is a little bit different: Your package prettifies every regular expression at once and mine does so on a case by case basis; I think it's a matter of preference. I also prettify the final rx form to make it more readable. I didn't know about the easy-escape package. I see it was suggested to be included in Emacs core around 2017, but there were no responses back then. Maybe we could have this kind of functionality at least in ELPA? I think it's a generally useful package.