]> git.eshelyaron.com Git - emacs.git/commitdiff
Make `make-local-variable' declare the var locally dynamic
authorMichael Heerdegen <michael_heerdegen@web.de>
Thu, 9 Apr 2020 23:21:33 +0000 (01:21 +0200)
committerMichael Heerdegen <michael_heerdegen@web.de>
Thu, 30 Apr 2020 18:50:33 +0000 (20:50 +0200)
The only effect of this change is to get rid of some unnecessary
"assignment to free variable" warnings.

* lisp/emacs-lisp/bytecomp.el (byte-compile-make-local-variable): New
function.

lisp/emacs-lisp/bytecomp.el

index 13b7219656544e4c15752f9e9c300624359c3d00..72dbfd74b11b59779341109aa7f4525c87c06c79 100644 (file)
@@ -4752,6 +4752,14 @@ binding slots have been popped."
 (defun byte-compile-form-make-variable-buffer-local (form)
   (byte-compile-keep-pending form 'byte-compile-normal-call))
 
+;; Make `make-local-variable' declare the variable locally
+;; dynamic - this suppresses some unnecessary warnings
+(byte-defop-compiler-1 make-local-variable
+                       byte-compile-make-local-variable)
+(defun byte-compile-make-local-variable (form)
+  (pcase form (`(,_ ',var) (byte-compile--declare-var var)))
+  (byte-compile-normal-call form))
+
 (put 'function-put 'byte-hunk-handler 'byte-compile-define-symbol-prop)
 (put 'define-symbol-prop 'byte-hunk-handler 'byte-compile-define-symbol-prop)
 (defun byte-compile-define-symbol-prop (form)