/* 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:
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);
"unescaped character literals "
"\", (, ), ;, [, ] detected!")))))
+(ert-deftest lread-test-bug26837 ()
+ "Test for http://debbugs.gnu.org/26837 ."
+ (let ((load-path (cons
+ (file-name-as-directory
+ (expand-file-name "data" (getenv "EMACS_TEST_DIRECTORY")))
+ load-path)))
+ (load "somelib" nil t)
+ (should (string-suffix-p "/somelib.el" (caar load-history)))
+ (load "somelib2" nil t)
+ (should (string-suffix-p "/somelib2.el" (caar load-history)))
+ (load "somelib" nil t)
+ (should (string-suffix-p "/somelib.el" (caar load-history)))))
+
;;; lread-tests.el ends here