[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""")'
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,)'
ha"\nha
$ ./emacs -Q -batch --eval '(message #r~ha"\nha~)'
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.
raw-string-python.diff
Description: Binary data
raw-string-sed.diff
Description: Binary data
- Raw strings (experimental patches inside),
Aurélien Aptel <=
- Re: Raw strings (experimental patches inside), Pascal J. Bourguignon, 2012/08/03
- Re: Raw strings (experimental patches inside), Aurélien Aptel, 2012/08/03
- Re: Raw strings (experimental patches inside), Lars Brinkhoff, 2012/08/05
- Re: Raw strings (experimental patches inside), Stefan Monnier, 2012/08/05
- Re: Raw strings (experimental patches inside), Pascal J. Bourguignon, 2012/08/06
- Re: Raw strings (experimental patches inside), Stefan Monnier, 2012/08/06
- Re: Raw strings (experimental patches inside), Pascal J. Bourguignon, 2012/08/06