all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Evgeny Zajcev <lg.zevlg@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: elisp--local-variables triggers an error on special input
Date: Thu, 17 Dec 2020 11:30:13 +0300	[thread overview]
Message-ID: <CAO=W_Zqvt2PavB2LtufzBv+7W2TQodjp=2DA-Ez+y7ti7P5DqQ@mail.gmail.com> (raw)
In-Reply-To: <jwv8sahsf94.fsf-monnier+emacs@gnu.org>


[-- Attachment #1.1: Type: text/plain, Size: 902 bytes --]

вт, 1 дек. 2020 г. в 18:45, Stefan Monnier <monnier@iro.umontreal.ca>:

> > 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.

-- 
lg

[-- Attachment #1.2: Type: text/html, Size: 1394 bytes --]

[-- Attachment #2: 0002-Make-Invalid-modifier-in-string-ordinary-invalid-rea.patch --]
[-- Type: text/x-patch, Size: 908 bytes --]

From 90647406fbf21d34c5ddd52303f0dc7685862d58 Mon Sep 17 00:00:00 2001
From: Zajcev Evgeny <zevlg@yandex.ru>
Date: Thu, 17 Dec 2020 11:27:20 +0300
Subject: [PATCH 2/2] Make "Invalid modifier in string" ordinary
 invalid-read-syntax error

* src/lread.ec (read1): Raise "Invalid modifier in string" error as
  `invalid-read-syntax'.  This fixes raise of unhandled error in
  `elisp--local-variables'
---
 src/lread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lread.c b/src/lread.c
index a3d5fd7bb8..3ef874039a 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -3438,7 +3438,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
 
 		/* Any modifiers remaining are invalid.  */
 		if (modifiers)
-		  error ("Invalid modifier in string");
+		  invalid_syntax ("Invalid modifier in string");
 		p += CHAR_STRING (ch, (unsigned char *) p);
 	      }
 	    else
-- 
2.25.1


  reply	other threads:[~2020-12-17  8:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-01 12:53 elisp--local-variables triggers an error on special input Evgeny Zajcev
2020-12-01 13:15 ` Joost Kremers
2020-12-01 14:24   ` tomas
2020-12-01 14:36     ` Joost Kremers
2020-12-01 20:16       ` tomas
2020-12-01 14:42     ` Gregory Heytings via Emacs development discussions.
2020-12-01 15:45 ` Stefan Monnier
2020-12-17  8:30   ` Evgeny Zajcev [this message]
2020-12-17 15:43     ` Stefan Monnier
2020-12-29  7:06       ` Evgeny Zajcev
2021-01-03  2:47         ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAO=W_Zqvt2PavB2LtufzBv+7W2TQodjp=2DA-Ez+y7ti7P5DqQ@mail.gmail.com' \
    --to=lg.zevlg@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.