[Top][All Lists]

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

Raw strings (experimental patches inside)

From: Aurélien Aptel
Subject: Raw strings (experimental patches inside)
Date: Fri, 3 Aug 2012 04:02:58 +0200

Hi all,

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.

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.

raw-string-python.diff use a syntax similar to python:

$ ./emacs -Q -batch --eval '(message #r"""ha"\nha""")'

raw-string-sed.diff use a syntax similar to sed or perl quotes. You
can chose any delimiter.

$ ./emacs -Q -batch --eval '(message #r,ha"\nha,)'
$ ./emacs -Q -batch --eval '(message #r~ha"\nha~)'

You get the idea.

Although the reader works, this breaks several things. C-x C-e doesn't
work well, sexp navigation is broken, etc. There is work to do to make
the rest of emacs aware of raw strings.

Attachment: raw-string-python.diff
Description: Binary data

Attachment: raw-string-sed.diff
Description: Binary data

reply via email to

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