* Can UNREAD completely undo READCHAR?
@ 2010-12-28 20:34 Leo
2010-12-28 22:10 ` Andreas Schwab
0 siblings, 1 reply; 3+ messages in thread
From: Leo @ 2010-12-28 20:34 UTC (permalink / raw)
To: emacs-devel
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: Can UNREAD completely undo READCHAR?
2010-12-28 20:34 Can UNREAD completely undo READCHAR? Leo
@ 2010-12-28 22:10 ` Andreas Schwab
2010-12-29 8:43 ` Leo
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2010-12-28 22:10 UTC (permalink / raw)
To: Leo; +Cc: emacs-devel
Leo <sdl.web@gmail.com> writes:
> I tried the following experiment (as in the attached patch) and emacs
> failed to dump. Any ideas? Thanks in advance.
You can unread at most one character.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Can UNREAD completely undo READCHAR?
2010-12-28 22:10 ` Andreas Schwab
@ 2010-12-29 8:43 ` Leo
0 siblings, 0 replies; 3+ messages in thread
From: Leo @ 2010-12-29 8:43 UTC (permalink / raw)
To: Andreas Schwab; +Cc: emacs-devel
On 2010-12-28 22:10 +0000, Andreas Schwab wrote:
> Leo <sdl.web@gmail.com> writes:
>
>> I tried the following experiment (as in the attached patch) and emacs
>> failed to dump. Any ideas? Thanks in advance.
>
> You can unread at most one character.
>
> Andreas.
Thanks.
Does that mean `load' can only test single char i.e. ; or spaces. If I
put #@3abc at the end of any lisp file, load produces an error. Do you
see a simple way of fixing this? (I want this so that a false feature
expression at the end of file won't cause any load error). Thank you.
Cheers,
Leo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-12-29 8:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-28 20:34 Can UNREAD completely undo READCHAR? Leo
2010-12-28 22:10 ` Andreas Schwab
2010-12-29 8:43 ` Leo
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.