From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Why "symbol's value" error about a list? Date: Tue, 06 Feb 2018 21:17:08 +0200 Message-ID: <83inba6i8b.fsf@gnu.org> 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> <79ef00e3-bf72-4944-a563-35c87e634e3f@default> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1517948423 15044 195.159.176.226 (6 Feb 2018 20:20:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 6 Feb 2018 20:20:23 +0000 (UTC) Cc: acm@muc.de, emacs-devel@gnu.org, rms@gnu.org, npostavs@users.sourceforge.net To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 06 21:20:19 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 1ej9iN-0001HZ-87 for ged-emacs-devel@m.gmane.org; Tue, 06 Feb 2018 21:19:40 +0100 Original-Received: from localhost ([::1]:56768 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9kO-0007KQ-Ce for ged-emacs-devel@m.gmane.org; Tue, 06 Feb 2018 15:21:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej8kH-0007BJ-Kp for emacs-devel@gnu.org; Tue, 06 Feb 2018 14:17:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej8kD-0000KB-FH for emacs-devel@gnu.org; Tue, 06 Feb 2018 14:17:33 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49314) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej8kD-0000K3-B6; Tue, 06 Feb 2018 14:17:29 -0500 Original-Received: from [176.228.60.248] (port=1369 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ej8k4-00056K-IT; Tue, 06 Feb 2018 14:17:21 -0500 In-reply-to: <79ef00e3-bf72-4944-a563-35c87e634e3f@default> (message from Drew Adams on Tue, 6 Feb 2018 07:45:55 -0800 (PST)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:222584 Archived-At: > Date: Tue, 6 Feb 2018 07:45:55 -0800 (PST) > From: Drew Adams > Cc: acm@muc.de, rms@gnu.org, npostavs@users.sourceforge.net, > emacs-devel@gnu.org > > > > > 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? > > > > 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. That's one possibility, yes. But a much more probable possibility is that the user mistyped the quote, either because she copy/pasted it from some text, or because she turned on the Electric Quote mode, or for some other reason. A useful error message should consider this latter probable cause and help the user correct it, if indeed that was the reason. Many tools do similar second-guessing for frequent mistakes. For example. GNU Make detects when a line in a Makefile starts with 8 SPC characters instead of a mandatory TAB, and says: *** missing separator (did you mean TAB instead of 8 spaces?). The first part is the "dumb" error message, based on the syntax error, the part in parentheses is a helpful hint for the user, based on many such user errors seen in the past. Latest versions of GCC also provide similar hints. > You've just made it necessary now to escape that curly quote when > defining and using the symbol: You are changing the subject. I just wrote that an error message which mentions "strange quotes" is somewhat better than one which just states the syntax error. I said nothing about anything else. > > > Symbol's value as variable is void: `’bar' > > > > That might make things even more confusing, because the text actually > > displayed will be this: > > Symbol’s value as variable is void: ‘’bar’ > > which loses all hints of what is being quoted here. > > I wrote `’bar'. Yes, but the Lisp function 'message' has its own ideas regarding quoting text, as you well know. Try evaluating this: (message "Symbol's value as variable is void: `%s'" "’bar") > > 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? You can try fighting this Quixotic battle on and on, but I don't recommend that. > You've introduced Lisp read errors where there were > none. No, I didn't do anything of the kind. > > > Should this Lisp syntax change be reverted? That's the > > > question being discussed here. > > > > 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. I think both steps should be made together, otherwise we would be making a change for the worse.