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
66ff2893
Commit
66ff2893
authored
Mar 25, 2003
by
Stefan Monnier
Browse files
(byte-optimize-set): New. Turn `set' into `setq' when applicable.
parent
999e6484
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
lisp/emacs-lisp/byte-opt.el
lisp/emacs-lisp/byte-opt.el
+12
-0
No files found.
lisp/emacs-lisp/byte-opt.el
View file @
66ff2893
...
@@ -1168,6 +1168,18 @@
...
@@ -1168,6 +1168,18 @@
(
if
(
equal
'
((
quote
xemacs
))
(
cdr-safe
form
))
(
if
(
equal
'
((
quote
xemacs
))
(
cdr-safe
form
))
nil
nil
form
))
form
))
(
put
'set
'byte-optimizer
'byte-optimize-set
)
(
defun
byte-optimize-set
(
form
)
(
let
((
var
(
car-safe
(
cdr-safe
form
))))
(
cond
((
and
(
eq
(
car-safe
var
)
'quote
)
(
consp
(
cdr
var
)))
(
list*
'setq
(
cadr
var
)
(
cddr
form
)))
((
and
(
eq
(
car-safe
var
)
'make-local-variable
)
(
eq
(
car-safe
(
setq
var
(
car-safe
(
cdr
var
))))
'quote
)
(
consp
(
cdr
var
)))
`
(
progn
,
(
cadr
form
)
(
setq
,
(
cadr
var
)
,@
(
cddr
form
))))
(
t
form
))))
;;; enumerating those functions which need not be called if the returned
;;; enumerating those functions which need not be called if the returned
;;; value is not used. That is, something like
;;; value is not used. That is, something like
...
...
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