emacs-devel
[Top][All Lists]
Advanced

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

Re: "Raw" string literals for elisp


From: Stefan Monnier
Subject: Re: "Raw" string literals for elisp
Date: Wed, 08 Sep 2021 16:18:23 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> I just think these are two separate dimensions which happen to align
> in the "regexp and backslash" case.

BTW, they can align in somewhat funny ways sometimes.
E.g. the raw-string version of the regexp "[ \t\n]" turns into something like

    #r"[
]"

which is not ideal in terms of clarity.  Similarly a regexp that matches
the NUL character will be problematic when written as a raw string
because it will need to embed the NUL character in the source code,
which in turn will cause tools like `grep` to treat the file as binary.

For the first problem above we can/should extend our regexp syntax to
include \t and \n as regexps that match TAB and LF respectively (that
would also be handy when writing regexps in the minibuffer).
But \0 is already used for other things so there's no such "obvious"
workaround for the second case :-(


        Stefan




reply via email to

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