emacs-devel
[Top][All Lists]
Advanced

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

Re: [ELPA] New package: xr


From: Mattias Engdegård
Subject: Re: [ELPA] New package: xr
Date: Fri, 1 Feb 2019 16:51:28 +0100

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 suggest that someone who would like to explore this in detail build a 
prototype using xr as the translation engine; its public interface should be 
quite sufficient for the task.




reply via email to

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