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: [ELPA] New package: xr Date: Fri, 1 Feb 2019 13:41:48 -0500 Message-ID: References: <2C8B37D2-2A22-451C-AA9E-E3CD73A90ABC@acm.org> 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="77204"; 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 Cc: emacs-devel@gnu.org To: =?UTF-8?Q?Mattias_Engdeg=c3=a5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 01 19:55:36 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 1gpdyR-000JxX-HM for ged-emacs-devel@m.gmane.org; Fri, 01 Feb 2019 19:55:35 +0100 Original-Received: from localhost ([127.0.0.1]:60011 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpdyO-00015e-9e for ged-emacs-devel@m.gmane.org; Fri, 01 Feb 2019 13:55:32 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:33477) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpdx3-000103-VW for emacs-devel@gnu.org; Fri, 01 Feb 2019 13:54:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gpdlI-0004wO-FV for emacs-devel@gnu.org; Fri, 01 Feb 2019 13:42:01 -0500 Original-Received: from mail-qt1-x82f.google.com ([2607:f8b0:4864:20::82f]:40423) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gpdlC-0004tf-0w for emacs-devel@gnu.org; Fri, 01 Feb 2019 13:41:56 -0500 Original-Received: by mail-qt1-x82f.google.com with SMTP id k12so8696762qtf.7 for ; Fri, 01 Feb 2019 10:41:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=nJgPkyoFXYQ0EliY+B9x6qDfJWkpH0uMFAey1YZwk60=; b=IxIaidtS9A4Sr/b8TcD+7+2XmADcLRDGZay5HoFSAlFq8eCycVIwbzg9SmIzaVdoIS XDUvo70FZZIQpPMrDfWK0pT9jQXc87401RrpDIUAWNGXpk6buVW0DvOGWKIh/eKhClgg bcn5qmn5axrLtZMXjSdZVdm9GF4mie6TEPdrbof7tq7dz+1UHKiJNEoF0qpNEBcddGw6 8ok7jScT6eKIWCQx11sI46DBJgm4UoAuUCjRCwmCwPcXXCrLmw5x4qA8nrsgpqGWc/h0 caRBi4S42YkYwYLwxDuHYm6rd3+4kpYAY01jCknbT5O7CPe7sLTMGzNlz+jR+dcCGxYd 6ryQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=nJgPkyoFXYQ0EliY+B9x6qDfJWkpH0uMFAey1YZwk60=; b=NKaojTzMd0htYFrYiOWJaGChh0zJ5OhayPdQpPJ7rK2ZwrTorZzZ/wk33JX50v2E+j INEyoCiXoteLs4n5sJ7p+Ocrer9sNkHvYpVQXb8tSzU2DzU2cw+jXxqk4JOOsqlYDIqA B1AZOxtzVW/H8oF6HR3KsWJoXFmQ9X4Hgf5s7FoSaCelth/1MhO0SjEtVYXdPg5WsiOl N4oN/vMEtvPRl0RgyN7vPeNX3EuTErUucK63kgK/GIiGsAhspuN+rsPCHb27sbaecHzF xj9sS0Zo9w/GMdNbE+U57nN4weMORJQIJ+p8XJxNyVYr07wpaIaC3SL3YeTPOl/FYcLM Mxdg== X-Gm-Message-State: AJcUukflplV2npemfxSvi2kSFNtnvwKePjrlATBJkqJXOT0Zvso8N5HX LhJT85cPkbaCYgNoyqL8PyT2oFm3 X-Google-Smtp-Source: ALg8bN497jSoZCSRjVO1HflwOs4ZYPRrIXxAFx+799kViNsFbhoOvB57spBsiIUZiKYG4PuQ4yCmcQ== X-Received: by 2002:a0c:be18:: with SMTP id k24mr38334424qvg.192.1549046509925; Fri, 01 Feb 2019 10:41:49 -0800 (PST) Original-Received: from [128.30.9.26] (30-9-26.wireless.csail.mit.edu. [128.30.9.26]) by smtp.googlemail.com with ESMTPSA id n67sm6052477qkd.95.2019.02.01.10.41.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Feb 2019 10:41:49 -0800 (PST) In-Reply-To: <2C8B37D2-2A22-451C-AA9E-E3CD73A90ABC@acm.org> 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::82f 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:232890 Archived-At: On 01/02/2019 10.51, Mattias Engdegård wrote: > 1 feb. 2019 kl. 16.25 skrev Clément Pit-Claudel : >> >> Looks great. Here's a feature request: can you combine this with a font-lock rule to display existing regexps in rx syntax? Something like prettify-symbols-mode, but for regular expressions. > > You mean a mode so that when the user is looking at the elisp source > > (if (looking-at "regexp-string") ... > > he would actually see > > (if (looking-at (rx translated-expression)) ... > > ? Could be done, I suppose, but since there is no special syntax for regexp strings, it would probably either need to rely on a list of well-known functions with regexp arguments, or second-guess it from their argument names (like REGEXP or PATTERN). It sounds a bit fragile. I would suggest neither; instead, it would convert only strings that contain regexp constructs (these are the ones that are hard to read in the first place). That;'s more or less what I do in https://github.com/cpitclaudel/easy-escape, and it works OK.