From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#2967: smart quotes in .emacs Date: Tue, 06 Jun 2017 23:46:48 -0400 Message-ID: <87ink8xxw7.fsf@users.sourceforge.net> References: <498421570904120553o69ee009dj544e0866b434b8a3@mail.gmail.com> 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 1496807180 29937 195.159.176.226 (7 Jun 2017 03:46:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 7 Jun 2017 03:46:20 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) Cc: 2967@debbugs.gnu.org, Alan Mackenzie , Stefan Monnier To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 07 05:46:10 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1dIRv8-0007DF-BW for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 Jun 2017 05:46:10 +0200 Original-Received: from localhost ([::1]:41106 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIRvB-0000N9-UE for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Jun 2017 23:46:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIRv3-0000N3-BO for bug-gnu-emacs@gnu.org; Tue, 06 Jun 2017 23:46:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIRv0-0005BJ-8w for bug-gnu-emacs@gnu.org; Tue, 06 Jun 2017 23:46:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57454) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dIRv0-0005B8-5S for bug-gnu-emacs@gnu.org; Tue, 06 Jun 2017 23:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dIRuz-00012Z-PA for bug-gnu-emacs@gnu.org; Tue, 06 Jun 2017 23:46:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 07 Jun 2017 03:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 2967 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 2967-submit@debbugs.gnu.org id=B2967.14968071183945 (code B ref 2967); Wed, 07 Jun 2017 03:46:01 +0000 Original-Received: (at 2967) by debbugs.gnu.org; 7 Jun 2017 03:45:18 +0000 Original-Received: from localhost ([127.0.0.1]:60131 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dIRuI-00011Z-Kb for submit@debbugs.gnu.org; Tue, 06 Jun 2017 23:45:18 -0400 Original-Received: from mail-io0-f172.google.com ([209.85.223.172]:36073) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dIRuH-00011N-16 for 2967@debbugs.gnu.org; Tue, 06 Jun 2017 23:45:17 -0400 Original-Received: by mail-io0-f172.google.com with SMTP id y77so1864109ioe.3 for <2967@debbugs.gnu.org>; Tue, 06 Jun 2017 20:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=mx7ETZlEZKbQLIX0uL1XoinrxV/tLqS4sKv9vDLklNU=; b=rm1r86IVaegHosZ4HszV0kSBc9Wa/YRlBBUM/mx0vyLjoLBw0q9u6uUcykTKyF056p teXbx+cyp98SqLh5BYJp8rmlHkHDE7HrWGpqb5q6QvLeon02f8nqCAdKjGiuipe17G0T PoiHm1WDu2ka+cboZoaEgkoubFkImFwqSFAq+ewCNHgbUYZm0jYsVKuUrOoWr67aRA9a FhuVRFVoE9981WrBQY50eJukHAECzQLz7ZTWHNwi+hPXe0bC953CswL8wJqri6sYQ+Rf tfeVqQAZnVghONK//dsSfrCpc66WHr8fM41qeoDB8+cuAIYPIVtVAfFQxTh+Lky1FB/c f8gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version :content-transfer-encoding; bh=mx7ETZlEZKbQLIX0uL1XoinrxV/tLqS4sKv9vDLklNU=; b=ff2nZBQucKYJn+s/AvV0Qj2BxUnmdQ/4cYZGp1eWpNlbq4Wk05bu3NVP8HiUo8vT7c L+8Xbb1QlHeQNrZ8u5yHiM2x2kUHsq5iHe6XCF1lVGvQlrl34bhvPvtDq3rQ7b5mXZn4 9jKq/2RXVTemkZlKacxOMq2IeoGDbG+Q9oS6n/262YYsLQDcdddbIt35uNJbpDn4O7UX ZwUxKa08tuCVbQD18tRO1TOrB+sNEKQaqpambj9nPSHvu1YdmBGBznj7gWVX+y9/vF38 +fOlvwGdLZMpfyA8Wk2vXlPU3c8YHPMCSWiHfau/1+MVRM6cKUlV09GV7OWG/8XbeIaZ PFEw== X-Gm-Message-State: AODbwcC7Etkgb+ExaLQRTbW7DC29Iio0kni9U9ygSPg0erlDaMmX8Mmb 3BGE4Xff+87P7A== X-Received: by 10.107.10.160 with SMTP id 32mr24702059iok.103.1496807111282; Tue, 06 Jun 2017 20:45:11 -0700 (PDT) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id e81sm181451ite.6.2017.06.06.20.45.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Jun 2017 20:45:10 -0700 (PDT) In-Reply-To: (Glenn Morris's message of "Fri, 10 Aug 2012 15:59:01 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:133356 Archived-At: Glenn Morris writes: > I assume the OP means something like: > > (set 'foo t) > > where the quote character is actually U+2019 "RIGHT SINGLE QUOTATION MARK" > rather than a plain old-ASCII apostrophe. > > This leads to errors like: > > Symbol's value as variable is void: 'foo Adding Alan to Cc, I think this is relevant also to the scenario in Bug#23425. I propose making these funny quotes give a read syntax error in symbol name contexts. Theoretically this breaks backwards compability with code that uses variables containing them, but probably no such code exists. Something like this (not sure if this is the best way to test for them): --- i/src/lread.c +++ w/src/lread.c @@ -3349,6 +3349,15 @@ read1 (Lisp_Object readcharfun, int *pch, bool first= _in_list) ? multibyte_chars_in_text ((unsigned char *) read_buffer, nbytes) : nbytes); + if (!quoted && multibyte) + { + switch (STRING_CHAR ((unsigned char *) read_buffer)) + { + case 0x2018: /* LEFT SINGLE QUOTATION MARK */ + case 0x2019: /* RIGHT SINGLE QUOTATION MARK */ + invalid_syntax ("strange quote"); + } + } Lisp_Object name =3D ((uninterned_symbol && ! NILP (Vpurify_flag) ? make_pure_string : make_specified_string) (read_buffer, nchars, nbytes, multibyte)); We then get the following error from evaluating (read (format-message "'foo= ")): Debugger entered--Lisp error: (invalid-read-syntax "strange quote") read("=E2=80=99foo") eval((read (format-message "'foo")) nil)