summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/bytecomp.el
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2023-08-09 11:27:28 +0000
committerAlan Mackenzie <acm@muc.de>2023-08-09 11:29:22 +0000
commit18a84922c5167c995f03c5c023c978f127d37dde (patch)
tree1a39ca7dc4af4ace12b17641cdec292a7dc31f9d /lisp/emacs-lisp/bytecomp.el
parent722b1ebc6e0ca23c018d5264e5c70b8f37bd9150 (diff)
downloademacs-18a84922c5167c995f03c5c023c978f127d37dde.tar.gz
emacs-18a84922c5167c995f03c5c023c978f127d37dde.tar.bz2
emacs-18a84922c5167c995f03c5c023c978f127d37dde.zip
Remove harmful and redundant bindings from the byte compiler.
This fixes bug#65017. Binding symbols-with-pos-enabled in two macro handling functions was harmful; one of these caused cl--labels-convert to fail. Binding print-symbols-bare in many places in the byte compiler was redundant. * lisp/emacs-lisp/bytecomp.el (byte-compile-recurse-toplevel) (byte-compile-initial-macro-environment) (byte-compile-output-file-form, byte-compile-output-docform) (byte-compile-preprocess): Remove bindings of print-symbols-bare. * lisp/emacs-lisp/macroexp.el (macroexp--compiler-macro) (internal-macroexpand-for-load): Remove bindings of symbols-with-pos-enabled. (internal-macroexpand-for-load): Remove binding of print-symbols-bare.
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r--lisp/emacs-lisp/bytecomp.el21
1 files changed, 8 insertions, 13 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 4ee9922302b..c98d02b1ec1 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -489,8 +489,7 @@ Return the compile-time value of FORM."
;; 3.2.3.1, "Processing of Top Level Forms". The semantics are very
;; subtle: see test/lisp/emacs-lisp/bytecomp-tests.el for interesting
;; cases.
- (let ((print-symbols-bare t)) ; Possibly redundant binding.
- (setf form (macroexp-macroexpand form byte-compile-macro-environment)))
+ (setf form (macroexp-macroexpand form byte-compile-macro-environment))
(if (eq (car-safe form) 'progn)
(cons (car form)
(mapcar (lambda (subform)
@@ -568,11 +567,10 @@ Only conses are traversed and duplicated, not arrays or any other structure."
;; Don't compile here, since we don't know
;; whether to compile as byte-compile-form
;; or byte-compile-file-form.
- (let* ((print-symbols-bare t) ; Possibly redundant binding.
- (expanded
- (macroexpand--all-toplevel
- form
- macroexpand-all-environment)))
+ (let ((expanded
+ (macroexpand--all-toplevel
+ form
+ macroexpand-all-environment)))
(eval (byte-run-strip-symbol-positions
(bytecomp--copy-tree expanded))
lexical-binding)
@@ -2489,8 +2487,7 @@ Call from the source buffer."
;; Spill output for the native compiler here
(push (make-byte-to-native-top-level :form form :lexical lexical-binding)
byte-to-native-top-level-forms))
- (let ((print-symbols-bare t) ; Possibly redundant binding.
- (print-escape-newlines t)
+ (let ((print-escape-newlines t)
(print-length nil)
(print-level nil)
(print-quoted t)
@@ -2524,8 +2521,7 @@ list that represents a doc string reference.
;; in the input buffer (now current), not in the output buffer.
(let ((dynamic-docstrings byte-compile-dynamic-docstrings))
(with-current-buffer byte-compile--outbuffer
- (let (position
- (print-symbols-bare t)) ; Possibly redundant binding.
+ (let (position)
;; Insert the doc string, and make it a comment with #@LENGTH.
(when (and (>= (nth 1 info) 0) dynamic-docstrings)
(setq position (byte-compile-output-as-comment
@@ -2621,8 +2617,7 @@ list that represents a doc string reference.
byte-compile-jump-tables nil))))
(defun byte-compile-preprocess (form &optional _for-effect)
- (let ((print-symbols-bare t)) ; Possibly redundant binding.
- (setq form (macroexpand-all form byte-compile-macro-environment)))
+ (setq form (macroexpand-all form byte-compile-macro-environment))
;; FIXME: We should run byte-optimize-form here, but it currently does not
;; recurse through all the code, so we'd have to fix this first.
;; Maybe a good fix would be to merge byte-optimize-form into