comparison lisp/bytecomp.el @ 5568:b039c0f018b8

Error if byte-compiling a form hasn't wrapped byte-compile-inbuffer. lisp/ChangeLog addition: 2011-09-09 Aidan Kehoe <kehoea@parhasard.net> * bytecomp.el (byte-compile-from-buffer): If compiling a form has changed the current buffer (that is, some eval-when-compile form hasn't done save-excursion when appropriate), error and exit; we can't guarantee we'll give useful code in that context. See http://mid.gmane.org/20110909110831.GD2875@acm.acm and related discussion.
author Aidan Kehoe <kehoea@parhasard.net>
date Fri, 09 Sep 2011 22:50:31 +0100
parents 4654c01af32b
children f0f1fd0d8486
comparison
equal deleted inserted replaced
5567:3bc58dc9d688 5568:b039c0f018b8
1862 (while (progn 1862 (while (progn
1863 (while (progn (skip-chars-forward " \t\n\^L") 1863 (while (progn (skip-chars-forward " \t\n\^L")
1864 (looking-at ";")) 1864 (looking-at ";"))
1865 (forward-line 1)) 1865 (forward-line 1))
1866 (not (eobp))) 1866 (not (eobp)))
1867 (byte-compile-file-form (read byte-compile-inbuffer))) 1867 (byte-compile-file-form (read byte-compile-inbuffer))
1868 (or (eq byte-compile-inbuffer (current-buffer))
1869 (error 'invalid-state
1870 "byte compiling didn't save-excursion appropriately"
1871 (current-buffer))))
1868 1872
1869 ;; Compile pending forms at end of file. 1873 ;; Compile pending forms at end of file.
1870 (byte-compile-flush-pending) 1874 (byte-compile-flush-pending)
1871 (byte-compile-insert-header filename byte-compile-inbuffer 1875 (byte-compile-insert-header filename byte-compile-inbuffer
1872 byte-compile-outbuffer) 1876 byte-compile-outbuffer)