[Top][All Lists]

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

Re: Raw strings (experimental patches inside)

From: Stefan Monnier
Subject: Re: Raw strings (experimental patches inside)
Date: Fri, 03 Aug 2012 18:43:33 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

> When I type a regex I'm always annoyed by the amount of escaping
> I have to do.  I've always wished Emacs Lisp had raw strings
> ie. a syntax to type litteral text without interpretation.

AFAIK, the only real use-case is indeed regexp, and for them a better
solution would be to not escape the parentheses at all.

> I've made 2 patch for the reader (src/lread.c). There are proofs of
> concepts, they should work on correct input but don't expect much.

Adapting the reader is only one part, since you also need to adapt the
elisp-mode syntax-tables accordingly (and check that the edebug reader
doesn't need matching changes).

As mentioned above, I'm not too excited by the idea of raw strings and
would prefer solving the underlying root cause of dissatisfaction.
Actually, we already have such a thing with `rx', but admittedly,
a strings representation of regexps tends to be more concise, so maybe
we also need some other trick like maybe a (re-escape "(?:foo)") which
would return "\\(?:foo\\)".


reply via email to

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