[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Change of Lisp syntax for "fancy" quotes in Emacs 27?

From: Drew Adams
Subject: RE: Change of Lisp syntax for "fancy" quotes in Emacs 27?
Date: Sat, 6 Oct 2018 00:20:27 +0000 (UTC)

> I'm not arguing that Elisp should prohibit symbols from containing
> confusing characters, only that these characters should be easily
> recognizable in plain-text source code, without requiring Emacs itself
> (configured a certain way) to view the source. For example, if we
> required a backslash before every confusable character in a symbol, that
> would go a long way toward addressing the problem.

The right approach is to let Lisp tell you about its syntax.
Lisp should raise an error only for, well, an actual Lisp error.

If Emacs wants to highlight something that it can guess
(accurately) might be a typo (e.g. a copy+paste gotcha)
then fine. And even that highlighting should be optional
(which it is, if from font-lock).

There are more and more such copy+paste gotchas, for
at least a couple reasons: (1) Emacs has now moved to
using curly quotes more gratuitously, and (2) users copy
code from both Emacs and other sources, and some such
code uses curly quotes (even sometimes mistakenly in
place of apostrophes in Lisp), no-break space chars, and
other confusables.

And maybe also (3) users can sometimes type a curly
quote, no-break space, etc. more easily now, in some
editors, maybe even sometimes by just hitting an
ordinary keyboard key, such as ' or space bar.

We have to live with this now, like it or not. That's not a
reason to tell Lisp to treat a curly quote as an apostrophe,
and it's not a reason to tell it to raise an error when a
curly quote is used in a place where an apostrophe could
be used.

Similarly, it's not a reason for Lisp to guess that you really
meant SPC instead of no-break space. And so on.

This is a judgment call, but we should _let Lisp judge_
about syntax errors, based on, well, its own syntax. If you
use (let (foo  foo)...), where there is a no-break space
between foo and foo, so be it. That's a single symbol,
`foo foo'.

(My mail client doesn't even let me paste a no-break
space char there, it seems, so you'll have to pretend.
That's the kind of second-guessing behavior we should
be avoiding, FWIW.)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]