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
89c91fdb
Commit
89c91fdb
authored
Sep 21, 2007
by
Glenn Morris
Browse files
Markus Triska <markus.triska at gmx.at>
(byte-compile-normal-call): Warn when `mapcar' is called for effect.
parent
195279a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/emacs-lisp/bytecomp.el
lisp/emacs-lisp/bytecomp.el
+4
-0
No files found.
lisp/ChangeLog
View file @
89c91fdb
2007-09-21 Markus Triska <markus.triska@gmx.at>
* emacs-lisp/bytecomp.el (byte-compile-normal-call): Warn when
`mapcar' is called for effect.
2007-09-21 Glenn Morris <rgm@gnu.org>
* obsolete/sun-fns.el (emacs-quit-menu): Remove emacstool-related code.
...
...
lisp/emacs-lisp/bytecomp.el
View file @
89c91fdb
...
...
@@ -2831,6 +2831,10 @@ That command is designed for interactive use only" fn))
(defun byte-compile-normal-call (form)
(if byte-compile-generate-call-tree
(byte-compile-annotate-call-tree form))
(when (and for-effect (eq (car form) 'mapcar))
(byte-compile-set-symbol-position 'mapcar)
(byte-compile-warn
"
`
mapcar
'
called
for
effect
; use `mapc' or `dolist' instead"))
(
byte-compile-push-constant
(
car
form
))
(
mapc
'byte-compile-form
(
cdr
form
))
; wasteful, but faster.
(
byte-compile-out
'byte-call
(
length
(
cdr
form
))))
...
...
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