From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: master 9613690: Raise an error when detecting old-style backquotes. Date: Mon, 09 Oct 2017 21:19:28 -0400 Message-ID: References: <20171008165905.14025.63605@vcs0.savannah.gnu.org> <20171008165907.42229201F3@vcs0.savannah.gnu.org> <87mv504js9.fsf@udel.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1507598403 661 195.159.176.226 (10 Oct 2017 01:20:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 10 Oct 2017 01:20:03 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 10 03:19:59 2017 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 1e1jD4-0006xN-Mi for ged-emacs-devel@m.gmane.org; Tue, 10 Oct 2017 03:19:50 +0200 Original-Received: from localhost ([::1]:60576 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1jDB-00005i-QA for ged-emacs-devel@m.gmane.org; Mon, 09 Oct 2017 21:19:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38239) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1jD1-0008W5-Sf for emacs-devel@gnu.org; Mon, 09 Oct 2017 21:19:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e1jCy-00018e-Mi for emacs-devel@gnu.org; Mon, 09 Oct 2017 21:19:47 -0400 Original-Received: from [195.159.176.226] (port=44449 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e1jCy-000183-Ex for emacs-devel@gnu.org; Mon, 09 Oct 2017 21:19:44 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1e1jCf-00042j-O8 for emacs-devel@gnu.org; Tue, 10 Oct 2017 03:19:25 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 48 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:4MVpiSxja//yC3Pg7gnz8Kx4jMA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:219321 Archived-At: > I've reverted the commit, but this should really be fixed. Apparently > Bovine generates incorrect code. Bovine uses the Lisp reader to `read` things like "( ,@$2 )" and "( foo ,$1 (car ,@$2) )". AFAICT it was designed for the old-style unquotes, but it's been tweaked to work correctly when those commas are treated as new-style unquotes. The patch below seems to work around this problem. Of course, as mentioned in another email, just always interpreting those unquotes as new-style works just as well (and with cleaner semantics). Stefan diff --git a/src/lread.c b/src/lread.c index c073fc4ce6..75c7e3ee55 100644 --- a/src/lread.c +++ b/src/lread.c @@ -2667,13 +2667,17 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) { int c; bool uninterned_symbol = false; + bool went_through_retry = false; bool multibyte; char stackbuf[MAX_ALLOCA]; current_thread->stack_top = stackbuf; *pch = 0; + goto skipretry; retry: + went_through_retry = true; + skipretry: c = READCHAR_REPORT_MULTIBYTE (&multibyte); if (c < 0) @@ -3202,6 +3206,9 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) of a list. */ if (new_backquote_flag || !first_in_list + /* If there was some separation (space, comment, ....) between the + `(` and the `,`, we consider this is a new-style unquote. */ + || went_through_retry || (next_char != ' ' && next_char != '@')) { Lisp_Object comma_type = Qnil;