unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Paul Eggert <eggert@cs.ucla.edu>,
	Noam Postavsky <npostavs@users.sourceforge.net>,
	Emacs developers <emacs-devel@gnu.org>
Subject: RE: Change of Lisp syntax for "fancy" quotes in Emacs 27?
Date: Fri, 2 Feb 2018 16:00:12 -0800 (PST)	[thread overview]
Message-ID: <150d3fe0-4ded-40cf-af3e-8e145fe8302f@default> (raw)
In-Reply-To: <16831945-e0fb-ab64-fc31-2534adf7bcf8@cs.ucla.edu>

> I see two main categories of users here, with different needs.
> Less-expert users are likely to run into problems with quotes
> and other characters (that's why we got bug reports), and
> appreciate diagnostics pinpointing the problems; also,
> programmers concerned about security are likely to want these
> confusing characters to be diagnosed, to prevent an attacker
> from sending code that is easily read one way but actually
> operates in a different way.
>
> On the other hand, programs that generate Elisp code might
> prefer not having to special-case these characters. So
> perhaps there should be a buffer-local variable that controls
> which behavior is selected. The default behavior should be
> the one that caters better to general users and is safer.

The distinction I think needs to be made is between:

1. Trying to _warn users_ (all users, less-expert or not)
   about possible misuse of particularly confusable chars.
   This just warns about possible pilot error.

2. _Changing Lisp_ reading and evaluating, to treat some
   (all?) confusable characters specially, changing their
   syntax and requiring them to be escaped in order to be
   treated normally (i.e., as they have been treated so far).

I object to #2, NOT to #1.

#1: By all means, we should try to help users.  We can
    issue byte-compilation warnings and some interactive
    warnings - provided we can helpfully and unambiguously
    distinguish the right situations.

#2 changes Lisp in non-neglible, non-helpful ways.
   See bug #30217 for more.

----

There are lots more characters to which the same
non-bug "fix" of changing Lisp might be applied (which
means that users will wonder why this confusable char
is treated specially, and not that one).

Such chars include pretty much anything that could be
confused with anything that is ever used as a delimiter
in Emacs Lisp: brackets (in the British sense) of all
sorts: parens, square, angle, curly.  There are really
quite a few such bracket-confusables.

Such chars also include pretty much anything that could
be confused with any other chars that are used specially
in Lisp: period, comma, quote, backquote, colon.  Again:
there are quite a few such confusables.

They even include chars that could be confused with the
directory separators used in Emacs Lisp.

Finally (?), they include chars that could be confused
with the ASCII-digit numerals 0123456789.  There are
lots of these confusables too.

(Even with just ASCII there are confusables.  Think of
what some use in passwords or leet: zero vs uppercase
letter O, digit 1 vs lowercase letter l, etc.  We've
just gotten used to carefully distinguishing such chars.
Now there are many more, and slighter, differences to
get used to.)

----

Beyond the question of which chars to treat specially,
there's the question of where - in which contexts -
to try to distinguish them.

Contexts include such places as sexps being evaluated,
doc strings, and comments.

They can also include fonts: a given character might
be confusable, or more confusable, in one font than
in another.  Even font size can make a difference
(with some fonts I find myself zooming in to see
whether a quote-thingy might really be a curly quote).

The questions of which chars and where (context) are
both relevant even if we only warn users (#1) and do
not change Lisp syntax (#2).

----

At the very least, I would hope that if we do anything
at all about this we would start by only warning.
I really hope we will not change Lisp syntax for this,
i.e., I hope we revert the change that has been made so
far for Emacs 27.

> While we're on the topic, I suggest using the Unicode
> confusables list ... to come up with a list of confusing
> alternatives for each character that has a special meaning
> in Emacs Lisp. This should be better than our trying to
> come up with our own, ad-hoc list.
>
> For example, U+A78C LATIN SMALL LETTER SALTILLO (ꞌ) looks
> almost exactly like an apostrophe on my screen and is in
> the confusables list, but is not a character that Emacs
> currently checks for.

Yup, and that's just one tiny tip of this terribly
tippy iceberg.



  reply	other threads:[~2018-02-03  0:00 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-02 22:24 Change of Lisp syntax for "fancy" quotes in Emacs 27? Noam Postavsky
2018-02-02 22:52 ` Paul Eggert
2018-02-03  0:00   ` Drew Adams [this message]
2018-02-03  0:09     ` Paul Eggert
2018-02-03  0:39       ` Drew Adams
2018-02-03  8:33 ` Eli Zaretskii
2018-02-03 16:16   ` Drew Adams
2018-02-03 17:05     ` Eli Zaretskii
2018-02-04  1:16       ` Michael Heerdegen
2018-02-04  1:25         ` Clément Pit-Claudel
2018-02-04  2:05           ` Drew Adams
2018-02-04  2:06           ` Michael Heerdegen
2018-02-04 10:34           ` Alan Third
2018-02-04 15:36             ` Clément Pit-Claudel
2018-02-04 17:37               ` Eli Zaretskii
2018-02-04 21:31                 ` Noam Postavsky
2018-02-04 11:15         ` Alan Mackenzie
2018-02-04 15:54           ` Drew Adams
2018-02-04 14:47         ` Noam Postavsky
2018-02-04  1:55       ` Drew Adams
2018-02-04  2:10         ` Noam Postavsky
2018-02-05  1:06       ` Why "symbol's value" error about a list? Richard Stallman
2018-02-05 20:35         ` Alan Mackenzie
2018-02-05 21:46           ` Drew Adams
2018-02-06  4:13             ` Eli Zaretskii
2018-02-06  7:32               ` Tim Cross
2018-02-06  7:40                 ` Eli Zaretskii
2018-02-06 15:45                 ` Drew Adams
2018-02-06 15:45               ` Drew Adams
2018-02-06 19:17                 ` Eli Zaretskii
2018-02-06 14:51           ` Richard Stallman
2018-02-06 11:27         ` Noam Postavsky
2018-02-06 14:53           ` Richard Stallman
2018-02-06 18:59             ` Eli Zaretskii
2018-02-07  2:40               ` Richard Stallman
2018-02-07  3:42                 ` Eli Zaretskii
2018-02-06 18:52           ` Eli Zaretskii
2018-02-05  1:06       ` Change of Lisp syntax for "fancy" quotes in Emacs 27? Richard Stallman
2018-02-03 18:13 ` Aaron Ecay
2018-02-04  2:05   ` Drew Adams
2018-02-04  4:51   ` Paul Eggert
2018-02-04  9:47     ` Andreas Schwab
2018-02-04 15:04     ` Noam Postavsky
2018-02-04 17:33       ` Eli Zaretskii
2018-02-04 19:36         ` Paul Eggert
2018-02-04 19:55           ` Philipp Stephani
2018-02-04 20:10           ` Eli Zaretskii
2018-02-04 20:36             ` Eli Zaretskii
2018-02-04 20:48               ` Paul Eggert
2018-02-04 20:59                 ` Clément Pit-Claudel
2018-10-05  0:03 ` Noam Postavsky
2018-10-05  1:01   ` Paul Eggert
2018-10-05  8:43     ` Eli Zaretskii
2018-10-05 23:02       ` Paul Eggert
2018-10-06  0:20         ` Drew Adams
2018-10-06  9:14           ` Alan Mackenzie
2018-10-06 14:34             ` Stefan Monnier
2018-10-06 14:57             ` Drew Adams
2018-10-06 15:42               ` Garreau, Alexandre
2018-10-06 16:10             ` Paul Eggert
2018-10-06 16:17           ` Paul Eggert
2018-10-07  1:13             ` Drew Adams
2018-10-08  3:51             ` Richard Stallman
2018-10-06 10:11         ` Eli Zaretskii
2018-10-06 15:51           ` Paul Eggert
2018-10-06 16:45             ` Eli Zaretskii
2018-10-06 18:03               ` Paul Eggert
2018-10-06 18:29                 ` Eli Zaretskii
2018-10-06 19:18                   ` Paul Eggert
2018-10-06 19:30                   ` Paul Eggert
2018-10-06 19:32                   ` Garreau, Alexandre
2018-10-06 11:22         ` Garreau, Alexandre
2018-10-06 11:50           ` Eli Zaretskii
2018-10-06 12:10             ` Garreau, Alexandre
2018-10-06 14:00               ` Eli Zaretskii
2018-10-24 22:25                 ` Noam Postavsky
2018-10-06 13:15             ` Unicode security-issues workarounds elsewhere [Was: Re: Change of Lisp syntax for "fancy" quotes in Emacs 27?] Garreau, Alexandre
2018-10-06 14:01               ` Eli Zaretskii
2018-10-06 16:24           ` Change of Lisp syntax for "fancy" quotes in Emacs 27? Paul Eggert
2018-10-06 16:40             ` Stefan Monnier
2018-10-09 14:43         ` Noam Postavsky
2018-10-09 15:30           ` Paul Eggert
2018-10-09 16:13             ` Eli Zaretskii
2018-10-09 17:07               ` Paul Eggert
2018-10-09 19:18                 ` Andreas Schwab
2018-10-10  9:39                   ` Aaron Ecay
2018-10-10 11:18                     ` Garreau, Alexandre
2018-10-10 14:31                       ` Eli Zaretskii
2018-10-10 15:18                   ` Eli Zaretskii
2018-10-10 15:43                     ` Drew Adams
2018-10-10 16:08                     ` Yuri Khan
2018-10-15 20:30                       ` Juri Linkov
2018-10-10  3:58                 ` Richard Stallman
2018-10-10  3:57           ` Richard Stallman
2018-10-10 14:41             ` Eli Zaretskii
2018-10-11  5:01               ` Richard Stallman
2018-10-06 15:40   ` eval-last-sexp / C-x C-e, and punctuation like `?’' [Was: Re: Change of Lisp syntax for "fancy" quotes in Emacs 27?)] Garreau, Alexandre
2018-10-16 12:48   ` Change of Lisp syntax for "fancy" quotes in Emacs 27? Garreau, Alexandre

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=150d3fe0-4ded-40cf-af3e-8e145fe8302f@default \
    --to=drew.adams@oracle.com \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=npostavs@users.sourceforge.net \
    /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).