1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00
emacs/test/lisp/emacs-lisp/bytecomp-resources
Alan Mackenzie c44903b011 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 (macroexp--posify-form-1)
(macroexp--posify-form): New functions.
(macroexp-preserve-posification): New macro.
(macroexp--compiler-macro, macroexp-macroexpand): Use the new
macro to preserve a calling form's position.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form): Use the new
macro to preserve source positions.

* test/lisp/emacs-lisp/bytecomp-resources/bad-error-position.el
* test/lisp/emacs-lisp/bytecomp-resources/bad-error-position-2.el:
New test files.
* test/lisp/emacs-lisp/bytecomp-tests.el: Two new tests using
the new test files.
2025-07-13 20:28:51 +00:00
..
bc-test-alpha.el
bc-test-beta.el
error-lexical-var-with-add-hook.el
error-lexical-var-with-remove-hook.el
error-lexical-var-with-run-hook-with-args-until-failure.el
error-lexical-var-with-run-hook-with-args-until-success.el
error-lexical-var-with-run-hook-with-args.el
error-lexical-var-with-symbol-value.el
foo-inlinable.el
fun-attr-warn.el
macro-warning-position-2.el
macro-warning-position.el
no-byte-compile.el
nowarn-inline-after-defvar.el
warn-autoload-not-on-top-level.el
warn-callargs-defsubst.el
warn-callargs.el
warn-defcustom-nogroup.el
warn-defcustom-notype.el
warn-defvar-lacks-prefix.el
warn-format.el
warn-free-setq.el
warn-free-variable-reference.el
warn-interactive-only.el
warn-lambda-malformed-interactive-spec.el
warn-make-process-missing-keyword-arg.el
warn-make-process-missing-keyword-value.el
warn-make-process-repeated-keyword-arg.el
warn-make-process-unknown-keyword-arg.el
warn-make-variable-buffer-local.el
warn-obsolete-defun.el
warn-obsolete-hook.el
warn-obsolete-variable-bound.el
warn-obsolete-variable-same-file.el
warn-obsolete-variable.el
warn-redefine-defun-as-macro.el
warn-redefine-defun.el
warn-redefine-macro-as-defun.el
warn-save-excursion.el
warn-variable-let-bind-constant.el
warn-variable-let-bind-nonvariable.el
warn-variable-set-constant.el
warn-variable-setq-nonvariable.el
warn-variable-setq-odd.el
warn-wide-docstring-autoload.el
warn-wide-docstring-custom-declare-variable.el
warn-wide-docstring-defalias.el
warn-wide-docstring-defconst.el
warn-wide-docstring-define-abbrev-table.el
warn-wide-docstring-define-obsolete-function-alias.el
warn-wide-docstring-define-obsolete-variable-alias.el
warn-wide-docstring-defun.el
warn-wide-docstring-defvar.el
warn-wide-docstring-defvaralias.el
warn-wide-docstring-ignore-fill-column.el
warn-wide-docstring-ignore-function-signature.el
warn-wide-docstring-ignore-override.el
warn-wide-docstring-ignore-substitutions.el
warn-wide-docstring-ignore.el
warn-wide-docstring-multiline-first.el
warn-wide-docstring-multiline.el