From db30296baed2d9c3c80eb89f6fae256e81ee2fbc Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 9 May 2017 19:44:09 -0400 Subject: Put re-loaded file back at start of load-history (bug#26837) * src/lread.c (readevalloop): Fix the "whole buffer" check to operate in the correct buffer. (Feval_buffer): Move point back to the start after checking for lexical binding. * test/src/lread-tests.el (lread-test-bug26837): New test. * test/data/somelib.el, test/data/somelib2.el: New test data files. --- src/lread.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/lread.c b/src/lread.c index 6467043b1da..f0ad0c28e56 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1885,7 +1885,7 @@ readevalloop (Lisp_Object readcharfun, /* On the first cycle, we can easily test here whether we are reading the whole buffer. */ if (b && first_sexp) - whole_buffer = (PT == BEG && ZV == Z); + whole_buffer = (BUF_PT (b) == BUF_BEG (b) && BUF_ZV (b) == BUF_Z (b)); instream = stream; read_next: @@ -2008,6 +2008,7 @@ This function preserves the position of point. */) record_unwind_protect (save_excursion_restore, save_excursion_save ()); BUF_TEMP_SET_PT (XBUFFER (buf), BUF_BEGV (XBUFFER (buf))); specbind (Qlexical_binding, lisp_file_lexically_bound_p (buf) ? Qt : Qnil); + BUF_TEMP_SET_PT (XBUFFER (buf), BUF_BEGV (XBUFFER (buf))); readevalloop (buf, 0, filename, !NILP (printflag), unibyte, Qnil, Qnil, Qnil); unbind_to (count, Qnil); -- cgit v1.2.1