aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Colascione2014-04-21 23:51:30 -0700
committerDaniel Colascione2014-04-21 23:51:30 -0700
commitc98212f9e7cef496dded06eba4476033062c171f (patch)
tree857c908a1e39a689f5d839aeb064755483dfa407
parentba9b77fe2049846c50cd09285c7b201412072f0d (diff)
downloademacs-c98212f9e7cef496dded06eba4476033062c171f.tar.gz
emacs-c98212f9e7cef496dded06eba4476033062c171f.zip
Minor bytecomp.el fixes
* lisp/emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment): Use lambda function values, not quoted lambdas. (byte-compile-recurse-toplevel): Remove extraneous &optional.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/emacs-lisp/bytecomp.el40
2 files changed, 25 insertions, 21 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c4b1c051210..38871c7ff32 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,7 +1,11 @@
12014-04-22 Daniel Colascione <dancol@dancol.org> 12014-04-22 Daniel Colascione <dancol@dancol.org>
2 2
3 * emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment):
4 Use lambda function values, not quoted lambdas.
5 (byte-compile-recurse-toplevel): Remove extraneous &optional.
6
3 * emacs-lisp/cl-macs.el 7 * emacs-lisp/cl-macs.el
4 (cl-struct-sequence-type,cl-struct-slot-info): Declare pure. 8 (cl-struct-sequence-type, cl-struct-slot-info): Declare pure.
5 (cl-struct-slot-value): Conditionally use aref or nth so that the 9 (cl-struct-slot-value): Conditionally use aref or nth so that the
6 compiler produces optimal code. 10 compiler produces optimal code.
7 11
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 923d2067a49..9c52cc44eb4 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -421,7 +421,7 @@ Filled in `cconv-analyse-form' but initialized and consulted here.")
421 421
422(defvar byte-compiler-error-flag) 422(defvar byte-compiler-error-flag)
423 423
424(defun byte-compile-recurse-toplevel (form &optional non-toplevel-case) 424(defun byte-compile-recurse-toplevel (form non-toplevel-case)
425 "Implement `eval-when-compile' and `eval-and-compile'. 425 "Implement `eval-when-compile' and `eval-and-compile'.
426Return the compile-time value of FORM." 426Return the compile-time value of FORM."
427 ;; Macroexpand (not macroexpand-all!) form at toplevel in case it 427 ;; Macroexpand (not macroexpand-all!) form at toplevel in case it
@@ -439,28 +439,28 @@ Return the compile-time value of FORM."
439 (funcall non-toplevel-case form))) 439 (funcall non-toplevel-case form)))
440 440
441(defconst byte-compile-initial-macro-environment 441(defconst byte-compile-initial-macro-environment
442 '( 442 `(
443 ;; (byte-compiler-options . (lambda (&rest forms) 443 ;; (byte-compiler-options . (lambda (&rest forms)
444 ;; (apply 'byte-compiler-options-handler forms))) 444 ;; (apply 'byte-compiler-options-handler forms)))
445 (declare-function . byte-compile-macroexpand-declare-function) 445 (declare-function . byte-compile-macroexpand-declare-function)
446 (eval-when-compile . (lambda (&rest body) 446 (eval-when-compile . ,(lambda (&rest body)
447 (let ((result nil)) 447 (let ((result nil))
448 (byte-compile-recurse-toplevel 448 (byte-compile-recurse-toplevel
449 (cons 'progn body) 449 (cons 'progn body)
450 (lambda (form) 450 (lambda (form)
451 (setf result 451 (setf result
452 (byte-compile-eval 452 (byte-compile-eval
453 (byte-compile-top-level 453 (byte-compile-top-level
454 (byte-compile-preprocess form)))))) 454 (byte-compile-preprocess form))))))
455 (list 'quote result)))) 455 (list 'quote result))))
456 (eval-and-compile . (lambda (&rest body) 456 (eval-and-compile . ,(lambda (&rest body)
457 (byte-compile-recurse-toplevel 457 (byte-compile-recurse-toplevel
458 (cons 'progn body) 458 (cons 'progn body)
459 (lambda (form) 459 (lambda (form)
460 (let ((compiled (byte-compile-top-level 460 (let ((compiled (byte-compile-top-level
461 (byte-compile-preprocess form)))) 461 (byte-compile-preprocess form))))
462 (eval compiled) 462 (eval compiled lexical-binding)
463 compiled)))))) 463 compiled))))))
464 "The default macro-environment passed to macroexpand by the compiler. 464 "The default macro-environment passed to macroexpand by the compiler.
465Placing a macro here will cause a macro to have different semantics when 465Placing a macro here will cause a macro to have different semantics when
466expanded by the compiler as when expanded by the interpreter.") 466expanded by the compiler as when expanded by the interpreter.")