From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Why "symbol's value" error about a list? Date: Tue, 6 Feb 2018 07:45:55 -0800 (PST) Message-ID: <79ef00e3-bf72-4944-a563-35c87e634e3f@default> References: <83o9l6bhfs.fsf@gnu.org> <1fedc60d-35a7-4ff0-adbb-b6b8306d192f@default> <83wozu9f6r.fsf@gnu.org> <20180205203544.GA5310@ACM> <6608d822-4e12-4f17-8a67-4a0d72de538c@default> <83shae7o2u.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1517931877 17493 195.159.176.226 (6 Feb 2018 15:44:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 6 Feb 2018 15:44:37 +0000 (UTC) Cc: acm@muc.de, emacs-devel@gnu.org, rms@gnu.org, npostavs@users.sourceforge.net To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 06 16:44:32 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ej5Pt-0003Uu-IS for ged-emacs-devel@m.gmane.org; Tue, 06 Feb 2018 16:44:17 +0100 Original-Received: from localhost ([::1]:58985 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5Ru-00080o-S5 for ged-emacs-devel@m.gmane.org; Tue, 06 Feb 2018 10:46:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41936) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5Rj-0007zi-MQ for emacs-devel@gnu.org; Tue, 06 Feb 2018 10:46:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej5Ri-0008RY-GJ for emacs-devel@gnu.org; Tue, 06 Feb 2018 10:46:11 -0500 Original-Received: from userp2130.oracle.com ([156.151.31.86]:33288) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej5Rc-0008Kw-JA; Tue, 06 Feb 2018 10:46:04 -0500 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w16Ffj8F180897; Tue, 6 Feb 2018 15:46:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=2pitS4QndUCehQbkrnaF+f5cPZQtWi/uWVmJ3mj5G00=; b=DT1m/DcPpfR9wlYMYEuW6Kep26PWO3EpD37C01uccQkmINhv4sbuV3VnaMTOz2tnEpBM s8zqQ2FHhKtxo9mQlCDdv6nq24HtrpGwvn//yJWczSpZxU3ubu8pZMxV5CHYt2hSLPm0 Upy1lqCOCMwk29pBqWGsB5dwrA725M4LzGuUdgeVx0lLC9TxeHVQdUAuZUyl4z06uPYC wMaXrauyLg/Aim7+Am3i5C4KQS/4/wEc5EhFLSbZu+c6rNR9VXmECDgqRZ8E09ddzu2d p90qoIZk+ttlOoO0pEp2NszHZwe5rBHB3xNcERQXQN71Ze9mkZXzsXqs2nXMf6GtxGmm yw== Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2fydy8rmvq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 06 Feb 2018 15:46:00 +0000 Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w16Fjx9i005402 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 6 Feb 2018 15:45:59 GMT Original-Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w16FjuPT022886; Tue, 6 Feb 2018 15:45:57 GMT In-Reply-To: <83shae7o2u.fsf@gnu.org> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4639.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8796 signatures=668662 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=818 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802060198 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 156.151.31.86 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:222578 Archived-At: > > > The error message given out is: > > > Symbol's value as variable is void: =E2=80=99bar > > > > 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" > > "=E2=80=99"). Is that better? >=20 > I think it's somewhat better, because it talks about "strange quote", > which is a hint for the user about the actual problem. The actual problem is the use of a non-variable symbol as a variable. At least that has been the problem in this example, until the recent change in Lisp syntax. There's no problem using a symbol as a variable if its name is =E2=80=99bar. You've just made it necessary now to escape that curly quote when defining and using the symbol: (defvar \=E2=80=99bar 42 "...") And if a variable in fact has that name you still raise a Lisp read-syntax error if the quote is not escaped. > > 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: `=E2=80=99bar' >=20 > That might make things even more confusing, because the text actually > displayed will be this: > Symbol=E2=80=99s value as variable is void: =E2=80=98=E2=80=99bar=E2= =80=99 > which loses all hints of what is being quoted here. I wrote `=E2=80=99bar'. > > > 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. >=20 > That ship has sailed two Emacs releases ago. We are trying to > fix the fallout. Two releases ago and still reaping the fallout rewards... Time to call back that ship or try to redirect it? > And strange quotes is only one situation where confusingly similar > characters can be presented in error messages, making it hard for > users to spot the real problem. We are trying to find ways of making > such "typos" more evident in error messages. Where's the error in (defvar =E2=80=99bar 42 "...")? You've introduced Lisp read errors where there were none. The error here is the automatic translation of a Lisp sexp that uses an ordinary quote mark (apostrophe) to a curly quote by `message' (?), so that the wrong sexp gets logged to *Messages*. The second error is trying to fix that error by changing Lisp syntax so that an error is raised, instead of just (optionally) displaying a warning message. There's no reason to stop Lisp evaluation just because we want to inform a user about a possible misunderstanding (gotcha). > > 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. >=20 > The issue is what _would_ be a helpful message in these cases. You > are just saying what should _not_ be done (repeatedly), but that > doesn't advance us towards the solution. I've said (repeatedly, as you like to repeat) that we can display all the warnings you like. What we should not do is change Lisp syntax to raise an artificial error. There is no Lisp error in evaluating (setq =E2=80=99bar 42), regardless of how or why someone might do that. It's fine to let someone know that s?he did it, pointing to the curly quote. It's wrong to raise a Lisp error. > > Should this Lisp syntax change be reverted? That's the > > question being discussed here. >=20 > No, that's only part of the question. The other, no less important > part is if we revert that change, how to make the confusing error > message less so and more helpful in understanding the user error. Agreed. The first step is to revert the change in Lisp syntax. The second step is to design aids for users to recognize such gotchas. The zeroth step is to realize that the Lisp change should be reverted.