1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-09 07:40:39 -08:00
emacs/lisp/emacs-lisp
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
..
advice.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
avl-tree.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
backquote.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
backtrace.el backtrace.el: Remove redundant put and :group 2025-03-25 14:16:03 -04:00
benchmark.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
bindat.el Fix capitalization ELisp -> Elisp 2025-03-12 09:38:33 +08:00
byte-opt.el Preserve source position of macro calls in macro expansions 2025-07-13 20:28:51 +00:00
byte-run.el Merge branch 'scratch/no-purespace' into 'master' 2025-02-01 04:56:52 +01:00
bytecomp.el Turn compiler macro defalias messages into warnings 2025-07-07 11:04:19 +02:00
cconv.el ; Replace "Elisp" with "Lisp" or "Emacs Lisp" in some places 2025-03-12 10:24:22 +08:00
chart.el Prefer incf to cl-incf in emacs-lisp/*.el 2025-02-23 00:38:22 +01:00
check-declare.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
checkdoc.el Teach checkdoc about (:this that) in cl-defun 2025-06-07 12:15:33 +03:00
cl-extra.el Make cl-random behave consistently for unusual arguments (bug#75105) 2025-06-20 06:09:24 +00:00
cl-generic.el register.el: Remove bogus deftypes and fix associated methods 2025-04-29 16:05:14 -04:00
cl-indent.el Prefer incf to cl-incf in emacs-lisp/*.el 2025-02-23 00:38:22 +01:00
cl-lib.el cl-types: Improve error messages 2025-05-08 17:11:05 -04:00
cl-macs.el (cl-deftype): Silence spurious warnings in xcb-types.el 2025-06-04 19:27:08 -04:00
cl-preloaded.el lisp/emacs-lisp/cl-preloaded.el (cl--define-derived-type): Fix corner case 2025-05-13 22:38:15 -04:00
cl-print.el vc-do-async-command: Ellipse later lines in multiline arguments 2025-04-12 10:05:57 +08:00
cl-seq.el Rewrite cl--parsing-keywords using backtick 2025-03-06 00:47:24 +01:00
comp-common.el ; Grammar fixes for "native-compiled" 2025-02-28 20:20:55 +01:00
comp-cstr.el Nativecomp don't materialize non-materializable objects (bug#78606) 2025-07-09 17:32:07 +02:00
comp-run.el Improve native--compile-skip-on-battery-p 2025-05-03 10:32:42 +08:00
comp.el Nativecomp don't materialize non-materializable objects (bug#78606) 2025-07-09 17:32:07 +02:00
compat.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
cond-star.el Fix Package name for cond-star 2025-03-10 07:45:21 -03:00
copyright.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
crm.el Merge from savannah/emacs-30 2025-03-04 14:32:33 +08:00
cursor-sensor.el (smerge-refine-shadow-cursor): New variable and face (bug#78806) 2025-06-23 00:00:38 -04:00
debug-early.el (debug--early): Avoid re-entering the debugger for the same error 2025-03-06 15:23:03 -05:00
debug.el (debug--early): Avoid re-entering the debugger for the same error 2025-03-06 15:23:03 -05:00
derived.el ; Use defvar-keymap in define-derived-mode 2025-03-18 00:33:32 +01:00
disass.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
easy-mmode.el New global minor mode vc-auto-revert-mode 2025-07-13 12:51:04 +01:00
easymenu.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
edebug.el Remove redundant constant nil argument to gethash 2025-03-29 14:59:09 +01:00
eieio-base.el (eieio-backward-compatibility): Set to warn (bug#77612) 2025-04-17 00:04:04 -04:00
eieio-core.el Call eieio--class-* accessors only on eieio classes (bug#78786) 2025-07-09 15:20:14 +00:00
eieio-custom.el lisp/emacs-lisp/eieio-custom.el: Require eieio-base to silence warning 2025-04-07 00:10:42 -04:00
eieio-datadebug.el Delete redundant lambdas around unary functions 2025-02-11 19:04:00 +01:00
eieio-opt.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
eieio-speedbar.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
eieio.el (eieio-backward-compatibility): Set to warn (bug#77612) 2025-04-17 00:04:04 -04:00
eldoc.el Eldoc: Run eldoc-display-functions with original buffer (bug#78530) 2025-07-09 19:28:45 -07:00
elp.el Prefer incf to cl-incf in emacs-lisp/*.el 2025-02-23 00:38:22 +01:00
ert-font-lock.el Clean up ert-font-lock error messages 2025-03-07 15:58:08 +01:00
ert-x.el (internal--c-header-file-path): Move to ffap.el 2025-02-28 17:03:21 -05:00
ert.el ; Fix last change 2025-06-18 21:08:30 +02:00
ewoc.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
faceup.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
find-func.el Merge from origin/emacs-30 2025-05-24 06:55:24 -04:00
float-sup.el Remove variable aliases obsolete since Emacs 23.2 2025-03-11 21:20:38 +01:00
generate-lisp-file.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
generator.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
generic.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
gv.el Add new gv place definitions 2025-06-29 07:29:25 +03:00
helper.el Use 'help-key' function in more places 2025-03-18 00:16:29 +01:00
hierarchy.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
icons.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
inline.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
let-alist.el Merge from origin/emacs-30 2025-02-01 07:39:56 -05:00
lisp-mnt.el ; Delete redundant defvar 2025-02-11 08:42:24 +01:00
lisp-mode.el (lisp-imenu-generic-expression): Add oclosure-define 2025-06-03 16:03:27 -04:00
lisp.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
loaddefs-gen.el ; Add Maintainer header to loaddefs-gen.el 2025-03-02 06:45:53 +01:00
macroexp.el Preserve source position of macro calls in macro expansions 2025-07-13 20:28:51 +00:00
map-ynp.el Fix 'save-some-buffers' when file name has embedded '%' 2025-06-07 16:35:42 +03:00
map.el Use 'hash-table-contains-p' in a few places 2025-03-29 14:59:44 +01:00
memory-report.el Prefer incf to cl-incf in emacs-lisp/*.el 2025-02-23 00:38:22 +01:00
multisession.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
nadvice.el (advice--make-nadvice-docstring): Rename 2025-03-03 22:18:02 -05:00
oclosure.el cl-types: Integrate into CL-Lib 2025-05-05 23:18:56 -04:00
package-vc.el Expand DIR arg on `package-vc-install-from-checkout' 2025-07-01 22:04:45 +02:00
package.el Add public interfaces for accessing builtin package info (Bug#78844) 2025-07-12 10:03:50 +03:00
pcase.el Prefer '(evenp A)' to '(= 0 (% A 2))' 2025-02-17 05:37:10 +01:00
pp.el Merge from origin/emacs-30 2025-06-21 06:26:10 -04:00
radix-tree.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
range.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
re-builder.el Fix capitalization ELisp -> Elisp 2025-03-12 09:38:33 +08:00
regexp-opt.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
regi.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
ring.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
rmc.el Delete redundant lambdas around unary functions 2025-02-11 19:04:00 +01:00
rx.el Make the rx eval form use lexical binding when active 2025-02-17 16:24:53 +01:00
seq.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
shadow.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
shortdoc.el New function 'hash-table-contains-p' 2025-03-29 14:59:36 +01:00
shorthands.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
smie.el lisp/emacs-lisp/smie.el (smie-config-show-indent): Tweak message 2025-03-18 08:42:42 -04:00
subr-x.el Clean up text properties in 'visual-wrap-prefix-mode' 2025-06-10 22:09:26 -07:00
syntax.el Prefer incf to cl-incf in emacs-lisp/*.el 2025-02-23 00:38:22 +01:00
tabulated-list.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
tcover-ses.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
testcover.el Remove redundant constant nil argument to gethash 2025-03-29 14:59:09 +01:00
text-property-search.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
thunk.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
timer-list.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
timer.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
tq.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
trace.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
track-changes.el lisp/emacs-lisp/track-changes.el: Make GNU ELPA release 2025-03-12 01:17:34 +01:00
unsafep.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
vtable.el Update copyright year to 2025 2025-01-02 18:39:42 +01:00
warnings.el Merge from origin/emacs-30 2025-07-12 05:25:02 -04:00