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: Thu, 17 Dec 2020 11:30:13 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="000000000000b4e63c05b6a4cd25" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34635"; 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 Thu Dec 17 09:32:25 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 1kpoi0-0008vo-Er for ged-emacs-devel@m.gmane-mx.org; Thu, 17 Dec 2020 09:32:24 +0100 Original-Received: from localhost ([::1]:38454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kpohz-00074x-Gy for ged-emacs-devel@m.gmane-mx.org; Thu, 17 Dec 2020 03:32:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33228) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpog9-0006LT-2N for emacs-devel@gnu.org; Thu, 17 Dec 2020 03:30:29 -0500 Original-Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]:38446) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kpog7-0008Pq-9a for emacs-devel@gnu.org; Thu, 17 Dec 2020 03:30:28 -0500 Original-Received: by mail-lf1-x134.google.com with SMTP id h205so11730360lfd.5 for ; Thu, 17 Dec 2020 00:30:26 -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=1FsZEGK8JBZ9GeSoGKRr7MP/cPkIa4TCEEL5ngG/AZ8=; b=ii+F2ppYsdU5i5Ru6fGzkGxt5pvUuRXqSSamqWtQGyH/6VlNljELU2X0e/ck2Tsz/P YhzHSrNV3At40RDsDMusFdq48+UIqAPr/QpevO7JPi1oxH8xH4fKcB7jrltsZYcQ56zw DSgbc3r2Vo5elexh1agKEsfEZHe7gaJ0uxeNh3rHqjzrkUS9VPplY5mk9m/Efae9rjCL s5ERXqTAjdGMBJiKxZBSWdIZNfjKXwZfe7OlAnd/DNXANtfRwWNMpEmpEGL21X5+mwji oxrVm38ZnsT3GD8aAoMn0jHJ184vBLE9TmkSpUazISXr3rI1HFRYFdz4pcONhH4YLyTx PgTQ== 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=1FsZEGK8JBZ9GeSoGKRr7MP/cPkIa4TCEEL5ngG/AZ8=; b=Ry/YYXDPhEFMxth25cKGt8SB6Ww8jHtsA24puTN/O8uyeMLwhF8eMR/i0/m71Clvk2 siw6wY19AAQcqQY5fvCWJTLwpKP/3csgVmQdLpvmxGA0v2fg7/uYcHLAlU0AuuMJRM3u zQPEUM2TbI689sSts4+L/Sd+20urV9urionH5//iZnEz/Xds+YqVCcQNz8HWzyAEQcK+ t6tWj0lVYAu1IFoRdbnFAFjYfjZUfzSbi270eA7Ewmljn1rKFpalhvfCGAkimX2c8YLT ugCWXwDihu1GbaBKH0cFYn4NzkpWgSCNFe56wzzfeqXDolvmfHRhF0egI+lvuq902Dcv +NFw== X-Gm-Message-State: AOAM5329ZkgQNA6WXUQPGkRPdvSJFmM1q8kQGcf/Z0fuZDTAptn8Q5dh ivUb7GuupcvS8alSWAp276+34UpPntAYx74yQQrqamy/ X-Google-Smtp-Source: ABdhPJwWc1BRtAKRGuvD2G+aXNbnAFnZCzKDRiwabikqlVbvyY47ba1UWMLEKBRHh0+2WI2LK5HIeRS2wwF2K46/hO4= X-Received: by 2002:a05:6512:20d2:: with SMTP id u18mr14003379lfr.47.1608193825623; Thu, 17 Dec 2020 00:30:25 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=lg.zevlg@gmail.com; helo=mail-lf1-x134.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:261091 Archived-At: --000000000000b4e63c05b6a4cd25 Content-Type: multipart/alternative; boundary="000000000000b4e63a05b6a4cd23" --000000000000b4e63a05b6a4cd23 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable =D0=B2=D1=82, 1 =D0=B4=D0=B5=D0=BA. 2020 =D0=B3. =D0=B2 18:45, Stefan Monni= er : > > I've noticed that sometimes company raises an error in my *scratch*, I'= ve > > shrinked the case and got: > > (with-current-buffer (get-buffer-create "pwp") > > (erase-buffer) > > (insert "((eg \"\C-,\")") > > (elisp--local-variables)) > > Evaluating this sexp raises "Invalid modifier in string" error > > Not sure this is intended, I think elisp--local-variables expects > > `invalid-read-syntax` error for this input, but got another error and > does > > not handle it preventing error from happening > > Clearly, `elisp--local-variables` should catch this error, but as you > point out, maybe the better way to do that is to change the error that > is signaled so that it is a child of `invalid-read-syntax`. > > I've composed a patch that fixes this, could you please apply it. --=20 lg --000000000000b4e63a05b6a4cd23 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
=D0=B2=D1=82, 1 =D0=B4=D0=B5=D0=BA. 2= 020 =D0=B3. =D0=B2 18:45, Stefan Monnier <monnier@iro.umontreal.ca>:
> I've noticed that sometimes compa= ny raises an error in my *scratch*, I've
> shrinked the case and got:
> (with-current-buffer (get-buffer-create "pwp")
>=C2=A0 =C2=A0(erase-buffer)
>=C2=A0 =C2=A0(insert "((eg \"\C-,\")")
>=C2=A0 =C2=A0(elisp--local-variables))
> Evaluating this sexp raises "Invalid modifier in string" err= or
> Not sure this is intended, I think elisp--local-variables expects
> `invalid-read-syntax` error for this input, but got another error and = does
> not handle it preventing error from happening

Clearly, `elisp--local-variables` should catch this error, but as you
point out, maybe the better way to do that is to change the error that
is signaled so that it is a child of `invalid-read-syntax`.


I've composed a patch that fixes t= his, could you please apply it.

--
lg
--000000000000b4e63a05b6a4cd23-- --000000000000b4e63c05b6a4cd25 Content-Type: text/x-patch; charset="US-ASCII"; name="0002-Make-Invalid-modifier-in-string-ordinary-invalid-rea.patch" Content-Disposition: attachment; filename="0002-Make-Invalid-modifier-in-string-ordinary-invalid-rea.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_kisl25k00 RnJvbSA5MDY0NzQwNmZiZjIxZDM0YzVkZGQ1MjMwM2YwZGM3Njg1ODYyZDU4IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBaYWpjZXYgRXZnZW55IDx6ZXZsZ0B5YW5kZXgucnU+CkRhdGU6 IFRodSwgMTcgRGVjIDIwMjAgMTE6Mjc6MjAgKzAzMDAKU3ViamVjdDogW1BBVEN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