Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
478d6f95
Commit
478d6f95
authored
Jun 20, 2011
by
Stefan Monnier
Browse files
* lisp/emacs-lisp/bytecomp.el (add-to-list): Add handler to check the
variable's status.
parent
ca530739
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/emacs-lisp/bytecomp.el
lisp/emacs-lisp/bytecomp.el
+19
-0
No files found.
lisp/ChangeLog
View file @
478d6f95
2011-06-21 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/bytecomp.el (add-to-list): Add handler to check the
variable's status.
2011-06-20 Jan Djärv <jan.h.d@swipnet.se>
* x-dnd.el (x-dnd-version-from-flags)
...
...
lisp/emacs-lisp/bytecomp.el
View file @
478d6f95
...
...
@@ -4244,6 +4244,25 @@ binding slots have been popped."
(
defun
byte-compile-form-make-variable-buffer-local
(
form
)
(
byte-compile-keep-pending
form
'byte-compile-normal-call
))
(
byte-defop-compiler-1
add-to-list
byte-compile-add-to-list
)
(
defun
byte-compile-add-to-list
(
form
)
;; FIXME: This could be used for `set' as well, except that it's got
;; its own opcode, so the final `byte-compile-normal-call' needs to
;; be replaced with something else.
(
pcase
form
(
`
(
,
fun
',var
.
,
_
)
(
byte-compile-check-variable
var
'assign
)
(
if
(
assq
var
byte-compile--lexical-environment
)
(
byte-compile-log-warning
(
format
"%s cannot use lexical var `%s'"
fun
var
)
nil
:error
)
(
unless
(
or
(
not
(
byte-compile-warning-enabled-p
'free-vars
))
(
boundp
var
)
(
memq
var
byte-compile-bound-variables
)
(
memq
var
byte-compile-free-references
))
(
byte-compile-warn
"assignment to free variable `%S'"
var
)
(
push
var
byte-compile-free-references
)))))
(
byte-compile-normal-call
form
))
;;; tags
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment