comparison lisp/emacs-lisp/bytecomp.el @ 49440:3f0a84732a62

(byte-compile-file-form-custom-declare-variable): Compile any lambda-expressions among the args.
author Richard M. Stallman <rms@gnu.org>
date Sat, 25 Jan 2003 19:44:24 +0000
parents 162c286faa11
children ae038951ece0 d7ddb3e565de
comparison
equal deleted inserted replaced
49439:34b5a595fbf4 49440:3f0a84732a62
8 ;; Maintainer: FSF 8 ;; Maintainer: FSF
9 ;; Keywords: lisp 9 ;; Keywords: lisp
10 10
11 ;;; This version incorporates changes up to version 2.10 of the 11 ;;; This version incorporates changes up to version 2.10 of the
12 ;;; Zawinski-Furuseth compiler. 12 ;;; Zawinski-Furuseth compiler.
13 (defconst byte-compile-version "$Revision: 2.119 $") 13 (defconst byte-compile-version "$Revision: 2.120 $")
14 14
15 ;; This file is part of GNU Emacs. 15 ;; This file is part of GNU Emacs.
16 16
17 ;; GNU Emacs is free software; you can redistribute it and/or modify 17 ;; GNU Emacs is free software; you can redistribute it and/or modify
18 ;; it under the terms of the GNU General Public License as published by 18 ;; it under the terms of the GNU General Public License as published by
2071 'byte-compile-file-form-custom-declare-variable) 2071 'byte-compile-file-form-custom-declare-variable)
2072 (defun byte-compile-file-form-custom-declare-variable (form) 2072 (defun byte-compile-file-form-custom-declare-variable (form)
2073 (if (memq 'free-vars byte-compile-warnings) 2073 (if (memq 'free-vars byte-compile-warnings)
2074 (setq byte-compile-bound-variables 2074 (setq byte-compile-bound-variables
2075 (cons (nth 1 (nth 1 form)) byte-compile-bound-variables))) 2075 (cons (nth 1 (nth 1 form)) byte-compile-bound-variables)))
2076 (let ((tail (nthcdr 4 form)))
2077 (while tail
2078 ;; If there are any (function (lambda ...)) expressions, compile
2079 ;; those functions.
2080 (if (and (consp (car tail))
2081 (eq (car (car tail)) 'function)
2082 (consp (nth 1 (car tail))))
2083 (setcar tail (byte-compile-lambda (nth 1 (car tail))))
2084 ;; Likewise for a bare lambda.
2085 (if (and (consp (car tail))
2086 (eq (car (car tail)) 'lambda))
2087 (setcar tail (byte-compile-lambda (car tail)))))
2088 (setq tail (cdr tail))))
2076 form) 2089 form)
2077 2090
2078 (put 'require 'byte-hunk-handler 'byte-compile-file-form-eval-boundary) 2091 (put 'require 'byte-hunk-handler 'byte-compile-file-form-eval-boundary)
2079 (defun byte-compile-file-form-eval-boundary (form) 2092 (defun byte-compile-file-form-eval-boundary (form)
2080 (let ((old-load-list current-load-list)) 2093 (let ((old-load-list current-load-list))