From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Raw strings (experimental patches inside) Date: Fri, 03 Aug 2012 18:43:33 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1344033821 27064 80.91.229.3 (3 Aug 2012 22:43:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 3 Aug 2012 22:43:41 +0000 (UTC) Cc: Emacs development discussions To: =?iso-8859-1?Q?Aur=E9lien?= Aptel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 04 00:43:41 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SxQar-00010h-Gt for ged-emacs-devel@m.gmane.org; Sat, 04 Aug 2012 00:43:41 +0200 Original-Received: from localhost ([::1]:49423 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SxQaq-0003he-JT for ged-emacs-devel@m.gmane.org; Fri, 03 Aug 2012 18:43:40 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39731) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SxQan-0003hO-SZ for emacs-devel@gnu.org; Fri, 03 Aug 2012 18:43:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SxQam-0004kv-VG for emacs-devel@gnu.org; Fri, 03 Aug 2012 18:43:37 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:41745) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SxQam-0004ko-RT for emacs-devel@gnu.org; Fri, 03 Aug 2012 18:43:36 -0400 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q73MhXIZ016311; Fri, 3 Aug 2012 18:43:34 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 3A095AE2F8; Fri, 3 Aug 2012 18:43:33 -0400 (EDT) In-Reply-To: (=?iso-8859-1?Q?=22Aur=E9lien?= Aptel"'s message of "Fri, 3 Aug 2012 04:02:58 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4299=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4299> : streams <794131> : uri <1183244> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:152155 Archived-At: > 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\\)". Stefan