diff --git a/etc/NEWS b/etc/NEWS index 95e53852cea..048f6d5598b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -872,6 +872,10 @@ Emacs buffers, like indentation and the like. The new ert function * Incompatible Lisp Changes in Emacs 29.1 +--- +** 'byte-compile-from-buffer' now uses 'load-read-function'. +It previously called 'read' directly. + ** User option 'mail-source-ignore-errors' is now obsolete. The whole mechanism for prompting users to continue in case of mail-source errors has been removed, so this option is no longer @@ -977,6 +981,7 @@ functions. * Lisp Changes in Emacs 29.1 ++++ ** New function 'readablep'. This function says whether an object can be written out and then read back by the Emacs Lisp reader. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 7dfe21441bd..436783819fa 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -2294,7 +2294,7 @@ With argument ARG, insert value in current buffer after the form." (setq byte-compile-read-position (point) byte-compile-last-position byte-compile-read-position) (let* ((lread--unescaped-character-literals nil) - (form (read inbuffer)) + (form (funcall load-read-function inbuffer)) (warning (byte-run--unescaped-character-literals-warning))) (when warning (byte-compile-warn "%s" warning)) (byte-compile-toplevel-file-form form))) diff --git a/src/lread.c b/src/lread.c index 2eff20f15df..a0af98fa0fb 100644 --- a/src/lread.c +++ b/src/lread.c @@ -5272,7 +5272,9 @@ of the file, regardless of whether or not it has the `.elc' extension. */); Vcurrent_load_list = Qnil; DEFVAR_LISP ("load-read-function", Vload_read_function, - doc: /* Function used by `load' and `eval-region' for reading expressions. + doc: /* Function used for reading expressions. +It is used by `load', `eval-region' and `byte-compile-from-buffer'. + Called with a single argument (the stream from which to read). The default is to use the function `read'. */); DEFSYM (Qread, "read");