all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Leo <sdl.web@gmail.com>
To: emacs-devel@gnu.org
Subject: Can UNREAD completely undo READCHAR?
Date: Tue, 28 Dec 2010 20:34:11 +0000	[thread overview]
Message-ID: <m1ei9163i4.fsf@cam.ac.uk> (raw)

Hello all,

I tried the following experiment (as in the attached patch) and emacs
failed to dump. Any ideas? Thanks in advance.

(gdb) r -batch -l loadup
Starting program: /Users/Shared/emacs/src/temacs -batch -l loadup
Reading symbols for shared libraries .++++++++++++........................................................................................ done
Loading loadup.el (source)...
Using load-path (/Users/Shared/emacs/lisp)
Loading emacs-lisp/byte-run...
Invalid read syntax: "#"

Program exited with code 0377.
(gdb) bt
No stack.
(gdb) 


diff --git a/src/lread.c b/src/lread.c
index 94d47d5..e28e70a 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1664,7 +1664,7 @@ readevalloop (readcharfun, stream, sourcename, evalfun,
      Lisp_Object unibyte, readfun;
      Lisp_Object start, end;
 {
-  register int c;
+  register int c, c2;
   register Lisp_Object val;
   int count = SPECPDL_INDEX ();
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
@@ -1760,6 +1760,9 @@ readevalloop (readcharfun, stream, sourcename, evalfun,
 	  || c == 0x8a0)  /* NBSP */
 	goto read_next;
 
+      c2 = READCHAR;
+      UNREAD (c2);
+
       if (!NILP (Vpurify_flag) && c == '(')
 	{
 	  record_unwind_protect (unreadpure, Qnil);


Leo




             reply	other threads:[~2010-12-28 20:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-28 20:34 Leo [this message]
2010-12-28 22:10 ` Can UNREAD completely undo READCHAR? Andreas Schwab
2010-12-29  8:43   ` Leo

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=m1ei9163i4.fsf@cam.ac.uk \
    --to=sdl.web@gmail.com \
    --cc=emacs-devel@gnu.org \
    /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.