From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Evgeny Zajcev Newsgroups: gmane.emacs.devel Subject: Re: elisp--local-variables triggers an error on special input Date: Tue, 29 Dec 2020 10:06:19 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c2805a05b79507ed" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34397"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 29 08:07:20 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ku96F-0008rg-Lg for ged-emacs-devel@m.gmane-mx.org; Tue, 29 Dec 2020 08:07:19 +0100 Original-Received: from localhost ([::1]:34004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ku96E-0006Er-Mo for ged-emacs-devel@m.gmane-mx.org; Tue, 29 Dec 2020 02:07:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ku95X-0005oC-Uj for emacs-devel@gnu.org; Tue, 29 Dec 2020 02:06:36 -0500 Original-Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]:35554) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ku95W-0004o5-9d for emacs-devel@gnu.org; Tue, 29 Dec 2020 02:06:35 -0500 Original-Received: by mail-lf1-x12c.google.com with SMTP id h22so28912423lfu.2 for ; Mon, 28 Dec 2020 23:06:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=v5qR5Aame6dCojwdNod2Pxb4AfERjoYcxDyfZjD2RXY=; b=lanBqr2caagCdTQs9GSI7JVnxPFIicjl9Uy+HEn+tkcV/EMfnpeTF/YPdGc1Na2KLz 8p8yl1FWqjViilgHAHic3vLWkDwCnEft9un0QtircLxaUrsMSAFGVk0NaPfzEqx3gJlo 9+tlaDlDfHAZiEdhC/tPQqM9KktLwwdBwfiL5bO9NnyjhzBsklvDlOlpRiqKKnj7iurI bqQEyz+pYiVAn9xUP3CYlWT8aBS4ZOcIfx4B/IM6Dt7UcjRZgukMDVQAb512NOT/2UBX QtOweT4d2UXK4kmK4Qs6Ew6q0vyhvk3qSOe/jvNln2f425hiRvjOJ5NAPykyrHquB9dj jhdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=v5qR5Aame6dCojwdNod2Pxb4AfERjoYcxDyfZjD2RXY=; b=epS33PAXHQ/gmqTJj28AZC32rcjR132GUbBbCRyz+oJdMTYayk/0MSqQgeNke8EJNW dgTW5vSGZP+v9v4YIgVvOI59j1tV63lZpKMqj+zeq8xFLG/MdqXfjTMmFH3Sz/vQOL9S 512JzRwEzcJ53K1qoDeakR8GVRQudZ8B1VlF0Ri5Plmg9S1+2q8dBLNfujt3hDXztkXG CvtALGA2RS+7VXWAFIsYsCigxFoN+8vW3j3lAbt+WRZLs5gIkXDxdFf+giya7Gjy0Cee 1qV1pfKYEc5p/W/bLSli2nIJSjoXVshloiD/Q1JN4USMAjC22wprNaA97AleWYxgkf8U 4sxA== X-Gm-Message-State: AOAM5318ZCD+hhQs37qs4+Fw+K0mBec5ZkX0AICeNboyElZgFHXOhxyq heAdZtzu4Z2SULZo1nfyKfGK8PHer+X7CX4XtRgZl/3q++M= X-Google-Smtp-Source: ABdhPJwjAlclDjZ46hq2oRbz5jR0XfuPGex7NMNu7U1Tf7sFs34tQhXm4mvHWiaZJnDDXp7ijtbqn1Fl+o43GqTwbOo= X-Received: by 2002:a2e:9b13:: with SMTP id u19mr22436738lji.48.1609225591749; Mon, 28 Dec 2020 23:06:31 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::12c; envelope-from=lg.zevlg@gmail.com; helo=mail-lf1-x12c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:262057 Archived-At: --000000000000c2805a05b79507ed Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable `elisp--local-variables' =D1=87=D1=82, 17 =D0=B4=D0=B5=D0=BA. 2020 =D0=B3. =D0=B2 18:43, Stefan Monn= ier : > > I've composed a patch that fixes this, could you please apply it. > > Done. > > This patch fixes this particular problem with lisp syntax reader, however `elisp--local-variables' remains *so* fragile, for example here I've got next errors from it: In these cases lisp syntax is ok, but `elisp--local-variables-1' fails on it: (with-current-buffer (get-buffer-create "bb") (erase-buffer) (insert "(let cc ") (elisp--local-variables)) =3D=3D> Lisp error: (wrong-type-argument listp cc) (with-current-buffer (get-buffer-create "bb") (erase-buffer) (insert "(let [a b]\n") (elisp--local-variables)) =3D=3D> Lisp error: (wrong-type-argument listp [a b]) Should we fix all these cases one by one, or maybe just run `elisp--local-variables` under `ignore-errors`, what do you think? --=20 lg --000000000000c2805a05b79507ed Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
`elisp--local-variables'

=D1=87=D1=82, 17 =D0= =B4=D0=B5=D0=BA. 2020 =D0=B3. =D0=B2 18:43, Stefan Monnier <monnier@iro.umontreal.ca>:
=
> I've composed a = patch that fixes this, could you please apply it.

Done.


This patch fixes this particular probl= em with lisp syntax reader, however `elisp--local-variables' remains *s= o* fragile, for example here I've got next errors from it:
In these cases lisp syntax is ok, but `elisp--local-variables-= 1' fails on it:

(with-current-buffer (get-buff= er-create "bb")
=C2=A0 (erase-buffer)
=C2=A0 (insert "= (let cc ")
=C2=A0 (elisp--local-variables))
=3D=3D> Lisp erro= r: (wrong-type-argument listp cc)

(with-current-bu= ffer (get-buffer-create "bb")
=C2=A0 (erase-buffer)
=C2=A0 = (insert "(let [a b]\n")
=C2=A0 (elisp--local-variables))
=3D=3D> Lisp error: (wrong-type-argument listp [a b])

Should we fix all these cases one by one, or maybe ju= st run `elisp--local-variables` under `ignore-errors`, what do you think?

--
lg=
--000000000000c2805a05b79507ed--