emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ELPA] New package: xr


From: Clément Pit-Claudel
Subject: Re: [ELPA] New package: xr
Date: Fri, 1 Feb 2019 13:41:48 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

On 01/02/2019 10.51, Mattias Engdegård wrote:
> 1 feb. 2019 kl. 16.25 skrev Clément Pit-Claudel <address@hidden>:
>>
>> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]