all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Spencer Baugh <sbaugh@janestreet.com>
Cc: dmitry@gutov.dev, Eli Zaretskii <eliz@gnu.org>, 68546@debbugs.gnu.org
Subject: bug#68546: 29.1.90; end-of-file has incorrect data when signaled within a load
Date: Thu, 17 Oct 2024 13:57:29 -0400	[thread overview]
Message-ID: <jwvmsj2litk.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <ier7ca9kwi7.fsf@janestreet.com> (Spencer Baugh's message of "Tue, 15 Oct 2024 15:16:00 -0400")

> diff --git a/src/lread.c b/src/lread.c
> index 95c6891c205..ec0c68e1843 100644
> --- a/src/lread.c
> +++ b/src/lread.c
> @@ -2329,8 +2329,8 @@ readevalloop_1 (int old)
>  static AVOID
>  end_of_file_error (void)
>  {
> -  if (STRINGP (Vload_true_file_name))
> -    xsignal1 (Qend_of_file, Vload_true_file_name);
> +  if (!NILP (Vread_end_of_file_data))
> +    xsignal1 (Qend_of_file, Vread_end_of_file_data);

Hmm... why call it `Vread_end_of_file_name`?
How 'bout something like `read--source`?  I suspect it could be useful to
include similar info in other read errors than `Qend_of_file`.
Also it could make sense to allow that var to indicate when we're
reading from a buffer (rather than a file).

>    xsignal0 (Qend_of_file);
>  }
> @@ -2434,6 +2434,8 @@ readevalloop (Lisp_Object readcharfun,
>    while (continue_reading_p)
>      {
>        specpdl_ref count1 = SPECPDL_INDEX ();
> +      if (NILP (Vread_end_of_file_data))
> +        specbind (Qread_end_of_file_name, Vload_true_file_name);

Why the `if` condition here?  Sounds like it could lead to problems for
nested loads and such.


        Stefan






      reply	other threads:[~2024-10-17 17:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17 19:04 bug#68546: 29.1.90; end-of-file has incorrect data when signaled within a load Spencer Baugh
2024-01-17 20:55 ` Dmitry Gutov
2024-01-25 14:05   ` Spencer Baugh
2024-01-25 14:12     ` Spencer Baugh
2024-01-26  0:55       ` Dmitry Gutov
2024-01-25 14:29     ` Eli Zaretskii
2024-01-26  0:45       ` Dmitry Gutov
2024-01-26  0:54     ` Dmitry Gutov
2024-02-16 21:56 ` Spencer Baugh
2024-02-17  7:14   ` Eli Zaretskii
2024-10-15 19:16     ` Spencer Baugh via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-17 17:57       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]

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=jwvmsj2litk.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=68546@debbugs.gnu.org \
    --cc=dmitry@gutov.dev \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=sbaugh@janestreet.com \
    /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.