From: Drew Adams <drew.adams@oracle.com>
To: Alan Mackenzie <acm@muc.de>, Richard Stallman <rms@gnu.org>
Cc: Eli Zaretskii <eliz@gnu.org>,
emacs-devel@gnu.org, npostavs@users.sourceforge.net
Subject: RE: Why "symbol's value" error about a list?
Date: Mon, 5 Feb 2018 13:46:38 -0800 (PST) [thread overview]
Message-ID: <6608d822-4e12-4f17-8a67-4a0d72de538c@default> (raw)
In-Reply-To: <20180205203544.GA5310@ACM>
> > > For example, suppose you have a Lisp program that produces the
> > > following error message when compiled/executed:
> > > Symbol's value as variable is void: 'аbbrevs-changed
>
> > Does that error message really happen? If so, how can I reproduce it?
>
> In Emacs-25.3 -Q, do M-: (message "(setq foo 'bar)") RET
> followed by getting the output from *Messages* into the kill ring with
> M-w, followed by M-: C-y RET.
>
> You might think you are executing (setq foo 'bar). You're not.
> You're executing (setq foo ’bar), where the ’ is a Unicode curly quote.
>
> The error message given out is:
> Symbol's value as variable is void: ’bar
That was the old, and legitimate, error message, yes. It
accurately describes what is really going on (as you describe
well, below).
Now the message is instead (invalid-read-syntax "strange quote"
"’"). Is that better? That's part of what this discussion is
about.
I suggested that the variable name be enclosed in `...'. That
would make the original message clearer, I think:
Symbol's value as variable is void: `’bar'
At least it could make it more likely that you would think about
looking at that quote mark.
> This is a result of the change in `message', silently to convert ' to a
> curly quote, by default. Some of us were unhappy at this change and
> protested against it.
Count me as one of those "some of us". Echoing Lisp code
should do just that - no fiddling to "prettify" apostrophe to
curly quote etc.
> > Suppose it were 'foobaz', all ASCII, and we got an error such as
> > Symbol's value as variable is void: 'foobaz
> > That still seems wrong.
Here's the thing: There _is_ a Lisp error - no doubt.
But for Lisp the error is not that a curly quote was read
as part of a symbol name. That's not a Lisp error (at
least it has not been, until now.)
The error is using a symbol as a variable, when it is not
defined as a variable. Which is exactly what the original
error message said.
That's the LISP error. Is there a _user error_ here?
Yes, it's the mistake of copying and pasting what was
printed in *Messages*.
That user mistake is excusable. And we would want to
inform the user about it, if we can't prevent it. But
changing Lisp read syntax to guess what might be the
most helpful thing to tell a user here is NOT the solution.
Should this Lisp syntax change be reverted? That's the
question being discussed here.
Changing the read syntax is a general, Lisp-level change.
We should instead prevent this user mistake by removing
its cause.
The real error here is (IMO) a design error by Emacs: The
expression read and copied to *Messages* should not have
been "helpfully" translated to use a curly quote instead
of an apostrophe.
Emacs shot Lisp in the foot on this one. It's not the
fault of Lisp and its reader (syntax). It's the fault of
some misguided "modernization" of Emacs gone amuck. Users
should not find the input (setq foo 'bar) transformed to
(setq foo ’bar), i.e., APOSTROPHE replaced by RIGHT SINGLE
QUOTATION MARK.
> Again "’foobaz", not "foobaz" is the symbol, here.
Yes, and that's a legitimate symbol name. Nothing wrong
with Lisp telling us that that symbol is undefined as a
variable. That's exactly what the _LISP_ problem is here.
That's just not the symbol that was passed to Lisp
originally. That's a non-variable symbol name copied from
*Messages*. The mistake was putting that in *Messages* in
the first place.
Where was the mistake? Lisp claiming that you used a
symbol as an undefined variable? The user copying that
symbol name from *Messages* and trying to evaluate its
symbol as a var? Or Emacs inserting a different symbol
name in *Messages*, by substituting the text "’bar" for
the text "'bar"?
The original Lisp expression was a Lisp expression, not
just text. A quote mark (apostrophe) in Lisp has special
meaning, special syntax. That shouldn't be ignored by
some dumb (yes) substitution of curly quotes for straight
quotes.
> > If the error was that foobaz was void, the error message
> > should not include a quote. It should say
> > Symbol's value as variable is void: foobaz
>
> Yes.
No. Only if `foobaz' were indeed the symbol that was an
undefined variable. But that's NOT the case here. The
undefined variable here is the symbol `’foobaz' (from
*Messages*) - it really is.
The underlying mistake took place long before Lisp
evaluation of the pasted sexp.
next prev parent reply other threads:[~2018-02-05 21:46 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
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 [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6608d822-4e12-4f17-8a67-4a0d72de538c@default \
--to=drew.adams@oracle.com \
--cc=acm@muc.de \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=npostavs@users.sourceforge.net \
--cc=rms@gnu.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.