]> git.eshelyaron.com Git - emacs.git/commitdiff
Compiler optimizer: push forms onto byte-compile-form-stack
authorAlan Mackenzie <acm@muc.de>
Mon, 27 Nov 2023 15:36:36 +0000 (15:36 +0000)
committerAlan Mackenzie <acm@muc.de>
Mon, 27 Nov 2023 15:36:36 +0000 (15:36 +0000)
This fixes bug#67483.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form): Push and
pop FORM onto/off byte-compile-form-stack so that warning
messages get a position near to the erroneous source.

lisp/emacs-lisp/byte-opt.el

index 2caaadc9f9e2c60ec57193b8d59e2eae340f2060..06257a9a2dab9d163282a3abc23040893383724c 100644 (file)
@@ -514,6 +514,7 @@ There can be multiple entries for the same NAME if it has several aliases.")
     (byte-optimize-form form for-effect)))
 
 (defun byte-optimize-form (form &optional for-effect)
+  (push form byte-compile-form-stack)
   (while
       (progn
         ;; First, optimize all sub-forms of this one.
@@ -530,6 +531,7 @@ There can be multiple entries for the same NAME if it has several aliases.")
                      (byte-compile-log "  %s\t==>\t%s" old new)
                       (setq form new)
                       (not (eq new old))))))))
+  (pop byte-compile-form-stack)
   form)
 
 (defun byte-optimize--rename-var-body (var new-var body)