From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matthew Plant Newsgroups: gmane.emacs.devel Subject: Raw string literals in Emacs lisp. Date: Fri, 25 Jul 2014 12:47:45 -0700 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c353cae9b88d04ff09d8f5 X-Trace: ger.gmane.org 1406317701 5306 80.91.229.3 (25 Jul 2014 19:48:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Jul 2014 19:48:21 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 25 21:48:12 2014 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 1XAlTK-0001T1-51 for ged-emacs-devel@m.gmane.org; Fri, 25 Jul 2014 21:48:06 +0200 Original-Received: from localhost ([::1]:56463 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAlTJ-0008EG-Pk for ged-emacs-devel@m.gmane.org; Fri, 25 Jul 2014 15:48:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45637) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAlT9-0008De-Kv for emacs-devel@gnu.org; Fri, 25 Jul 2014 15:48:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XAlT1-0001qy-Tu for emacs-devel@gnu.org; Fri, 25 Jul 2014 15:47:55 -0400 Original-Received: from mail-la0-f65.google.com ([209.85.215.65]:36905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAlT1-0001qo-NH for emacs-devel@gnu.org; Fri, 25 Jul 2014 15:47:47 -0400 Original-Received: by mail-la0-f65.google.com with SMTP id ty20so1067494lab.4 for ; Fri, 25 Jul 2014 12:47:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=b9O+Lp+aNtlFGV7ajLi9vJL0lkoyG/Q9c/mSOqu/wKg=; b=kxapmFzSinXXSHqsOVK2pASWtEb69FbVO5oxcB7HQneoSMcJAJjB98sK7C5NMW8FnQ Ev6kvaZGt0/t5K7Rz9crQ+/nyt8hv9FZv6n1X6yz9EJ/KBfyfr/UrApI2vLuiY2kmkt+ Dl50bF4Zz3ymH1tbttRD6+1DcllCXX+YYUBrDfwagXosG3jOtx0ZKNhZA16ZuDJHtGvN bO8wu7JL/ScvTS7h100skODLvbT501VyXMOorjNzAsS69TNJr+qGVk+6WGnUTtw/AauG 2D5MubMqHGzEPP2OIJApFEy8P9zHv5Dxm1zJbU7+nrMmov/iQIeudFWG/Sk2638/hk1F O+IA== X-Gm-Message-State: ALoCoQn6t90j16fdHYdf/iXIUe7z5KNuwzzmCmJALuUB9HKTUVjmNmHnXf3gztEXH4tYFWTfNiDp X-Received: by 10.152.88.39 with SMTP id bd7mr4241857lab.89.1406317665819; Fri, 25 Jul 2014 12:47:45 -0700 (PDT) Original-Received: by 10.112.185.99 with HTTP; Fri, 25 Jul 2014 12:47:45 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.215.65 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:173149 Archived-At: --001a11c353cae9b88d04ff09d8f5 Content-Type: text/plain; charset=UTF-8 I think that raw string literals would be a really nice thing to add to Emacs lisp. The most immediate benefit is that writing regexps would be much easier. And since most of the work that goes into major modes is writing regexp, writing major modes would become a lot faster. Obviously it can't be done in any way that's really consistent with the language (it'd be super nice if ``string'' could be used, but alas). However, perhaps I have found a reasonable approach. What if we assume that any string surrounded immediately by parenthesis is a raw string literal? I'm pretty sure every instance of ("...") is currently illegal, and it would be almost certainly trivial to extend the Emacs' lexer/parser to support it. I can do it myself if everyone thinks this is a good idea. Please let me know what your thoughts are on this. -Matt --001a11c353cae9b88d04ff09d8f5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I think that raw string literals would be a really nice th= ing to add to Emacs
lisp. The most immediate benefit is that writing reg= exps would be much easier.
And since most of the work that goes into maj= or modes is writing regexp, writing
major modes would become a lot faster.

Obviously it can't be don= e in any way that's really consistent with the language
(it'd be= super nice if ``string'' could be used, but alas). However, perhap= s I
have found a reasonable approach.

What if we assume that any string = surrounded immediately by parenthesis is a raw
string literal? I'm p= retty sure every instance of ("...") is currently illegal,
and it would be almost certainly trivial to extend the Emacs' lexer/par= ser to
support it. I can do it myself if everyone thinks this is a good= idea.

Please let me know what your thoughts are on this.

-Matt
--001a11c353cae9b88d04ff09d8f5--