unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: Richard Stallman <rms@gnu.org>
Cc: stephen@xemacs.org, emacs-devel@gnu.org
Subject: Re: Raw string literals in Emacs lisp.
Date: Tue, 05 Aug 2014 08:15:14 +0200	[thread overview]
Message-ID: <874mxro425.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <E1XETkT-0001c1-7r@fencepost.gnu.org> (Richard Stallman's message of "Mon, 04 Aug 2014 21:41:09 -0400")

Richard Stallman <rms@gnu.org> writes:

> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
>     Well, I am not sure about the size of the wart in practice.  It has not
>     apparently caused much of a disturbance for XEmacs.  It certainly seems
>     less relevant in practice than our traditional wart
>
>     (info "(emacs) Left Margin Paren")
>
>     with regard to reliable detection of strings out of context.
>
> That problem is in a different feature (finding the start of a
> function), and we recommend a preventive measure to avoid it.

The preventive measure is not working in source buffers other than Elisp
and it requires manual intervention.  M-q seems to avoid _moving_ an
opening parent to the front of the line in strings: that is already a
big help in avoiding them to creep in when reformatting code.
auto-fill-mode however doesn't, so you don't get help against
accidentally introducing them.

> So it is not a real problem.  In Elisp, it is a solved problem.

More like a "problem with known manual workarounds".

> But even if it were a real problem, this argument is invalid in form.
> The existence of one problem we can't fix does not make it good
> to create another.

Sure.  I was just putting it in perspective: in practice the ambiguity
of r#"?\" without leading context is not going to cause anywhere near
the pain users already have to deal with.  I am not saying that this is
a non-problem.  But in contrast to the paren problem, it is a fringe
problem not likely to occur in practice.  So I consider it likely to be
less annoying in its effects to users than a raw string syntax diverging
from that of XEmacs which would basically imply that any portable code
has to forego raw strings completely.

Of course, if Emacs can come up with a significantly better proposal,
there is some likelihood that it will eventually _also_ be adopted by
XEmacs.

But as long as strings and raw strings share the same ending delimiter
and/or the ending delimiter of a raw string has a valid other syntactic
interpretation on its own, the ambiguity will be there.  ASCII does not
offer a wealth of delimiter candidates, and having to write something
like #r"fa\fa d\fd \fd safa"#r would likely be more annoying than the
problem it is supposed to cure.

I am not saying that #r"..." is what we should ultimately take, just
that I don't see the counterargument as weighing all that strongly.  I
actually would likely prefer something like #"..." as input but that's
even more likely to trip up backward parsing.

-- 
David Kastrup



  reply	other threads:[~2014-08-05  6:15 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-25 19:47 Raw string literals in Emacs lisp Matthew Plant
2014-07-25 19:56 ` Tassilo Horn
2014-07-25 20:06   ` Matthew Plant
2014-07-25 20:15     ` Tassilo Horn
2014-07-25 20:24       ` Matthew Plant
2014-07-25 20:33 ` Tom Tromey
2014-07-25 21:40   ` Matthew Plant
2014-07-26  1:19 ` Stephen J. Turnbull
2014-07-26  5:28   ` Matthew Plant
2014-07-26  5:45     ` chad
2014-07-26 19:39       ` Matthew Plant
2014-07-27 12:27         ` Stephen J. Turnbull
2014-07-27 13:03           ` David Kastrup
2014-07-27 20:58             ` David Caldwell
2014-07-27 23:17               ` Matthew Plant
2014-07-28 18:27                 ` Richard Stallman
2014-07-28 19:32                   ` Matthew Plant
2014-07-29 19:15                     ` Richard Stallman
2014-07-30  0:26                       ` Matthew Plant
2014-07-30  4:28                         ` Richard Stallman
2014-07-30 18:54                           ` Matthew Plant
2014-07-28  2:16               ` Stephen J. Turnbull
2014-07-28  7:43                 ` Andreas Schwab
2014-07-30 20:28               ` Ted Zlatanov
2014-07-30 20:41                 ` David Caldwell
2014-07-30 20:54                   ` Ted Zlatanov
2014-07-30 21:01                     ` Matthew Plant
2014-07-30 21:16                       ` Ted Zlatanov
2014-07-30 21:19                         ` Matthew Plant
2014-07-31 10:13                           ` Ted Zlatanov
2014-08-02  8:47                     ` Alan Mackenzie
2014-08-02  9:14                       ` David Kastrup
2014-08-02 10:23                         ` Alan Mackenzie
2014-08-02 15:51                           ` Richard Stallman
2014-08-03  6:50                         ` Stephen J. Turnbull
2014-08-03  7:29                           ` David Kastrup
2014-08-03 13:12                             ` Stephen J. Turnbull
2014-08-03 13:27                               ` David Kastrup
2014-08-03 15:01                                 ` Stephen J. Turnbull
2014-08-04  1:55                                   ` Richard Stallman
2014-08-04  6:38                                     ` David Kastrup
2014-08-05  1:41                                       ` Richard Stallman
2014-08-05  6:15                                         ` David Kastrup [this message]
2014-08-03 13:40                               ` David Kastrup
2014-08-03 15:06                                 ` Stephen J. Turnbull
2014-08-04  1:55                           ` Richard Stallman
2014-08-02  9:17                     ` Andreas Schwab
2014-07-28  1:29             ` Stephen J. Turnbull
2014-07-26 21:37 ` Thorsten Jolitz
2014-07-29  6:32 ` William Xu
2014-07-29  7:40   ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874mxro425.fsf@fencepost.gnu.org \
    --to=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    --cc=stephen@xemacs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).