diff options
author | Alan Mackenzie <acm@muc.de> | 2024-10-20 14:04:26 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2024-10-20 14:04:26 +0000 |
commit | 2114a955c23c213168f012f5e480edae46561fd2 (patch) | |
tree | 421010faf2063a4d981c137a3d1cfe79cd033865 /lisp/emacs-lisp/comp-run.el | |
parent | 6c928e490d3347cc309eda51cefbc46fba955650 (diff) | |
download | emacs-2114a955c23c213168f012f5e480edae46561fd2.tar.gz emacs-2114a955c23c213168f012f5e480edae46561fd2.tar.bz2 emacs-2114a955c23c213168f012f5e480edae46561fd2.zip |
Preserve source position of macro calls in macro expansions
This allows the byte compiler to give correct positions, those
of the invoking forms, when an error or warning is caused by
the innards of the invoked macros.
This fixes bug#73725 and bug#73746.
* lisp/emacs-lisp/macroexp.el (sub-macroexp--posify-form)
(macroexp--posify-form): New functions.
(macroexp-preserve-posification): New macro.
(macroexp-macroexpand): Use the new macro to preserve a calling
form's position.
(macroexpand-all): Add a new parameter `keep-pos' which
instructs the function to preserve an invoking form's position.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form): Use the new
macro to preserve source positions.
* lisp/emacs-lisp/bytecomp.el (byte-compile-preprocess): Call
macroexpand-all with the new argument `keep-pos' non-nil.
Diffstat (limited to 'lisp/emacs-lisp/comp-run.el')
0 files changed, 0 insertions, 0 deletions