GNU bug report logs - #63722
29.0.91; (elisp) Skip to end #@00 does not work

Previous Next

Package: emacs;

Reported by: richard newton <richardn26 <at> gmail.com>

Date: Thu, 25 May 2023 17:39:02 UTC

Severity: normal

Found in version 29.0.91

Done: Mattias EngdegÄrd <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 63722 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: richard newton <richardn26 <at> gmail.com>, Mattias EngdegÄrd <mattiase <at> acm.org>
Cc: 63722 <at> debbugs.gnu.org
Subject: Re: bug#63722: 29.0.91; (elisp) Skip to end #@00 does not work
Date: Thu, 25 May 2023 21:44:28 +0300
> From: richard newton <richardn26 <at> gmail.com>
> Date: Thu, 25 May 2023 16:19:42 +0200
> 
> With emacs 29.0.91 pretest, the "skip to end" syntax #@00 no longer seems to work. For example,
> with the three lines below in a buffer (eval-buffer) gives the error - End of file during parsing. With
> previous emacs versions it did not complain.
> 
> (setq testStr "zz")
> #@00
> should be ignored

Thanks.

Mattias, this is due to commit b903507b36, which fixed bug#55676.  It
introduced a subtle change in the behavior of read0 in this case.

Does the below look like the correct way of fixing this regression?

diff --git a/src/lread.c b/src/lread.c
index 342d367..6ee2829 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -3400,8 +3400,9 @@ read_bool_vector (Lisp_Object readcharfun)
 }
 
 /* Skip (and optionally remember) a lazily-loaded string
-   preceded by "#@".  */
-static void
+   preceded by "#@".  Return non-zero if we skip to EOB,
+   otherwise zero.  */
+static bool
 skip_lazy_string (Lisp_Object readcharfun)
 {
   ptrdiff_t nskip = 0;
@@ -3429,7 +3430,7 @@ skip_lazy_string (Lisp_Object readcharfun)
 	{
 	  /* #@00 means "skip to end" */
 	  skip_dyn_eof (readcharfun);
-	  return;
+	  return true;
 	}
     }
 
@@ -3476,6 +3477,8 @@ skip_lazy_string (Lisp_Object readcharfun)
   else
     /* Skip that many bytes.  */
     skip_dyn_bytes (readcharfun, nskip);
+
+  return false;
 }
 
 /* Given a lazy-loaded string designator VAL, return the actual string.
@@ -3933,7 +3936,8 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
 	    /* #@NUMBER is used to skip NUMBER following bytes.
 	       That's used in .elc files to skip over doc strings
 	       and function definitions that can be loaded lazily.  */
-	    skip_lazy_string (readcharfun);
+	    if (skip_lazy_string (readcharfun))
+	      return unbind_to (base_pdl, Qnil);
 	    goto read_obj;
 
 	  case '$':




This bug report was last modified 2 years and 49 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.