• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/emacs-lisp/

Lines Matching +defs:cl +defs:compiler +defs:macro

30 ;; The Emacs Lisp byte compiler.  This crunches lisp source into a sort
46 ;; This version of the byte compiler has the following improvements:
96 ;; a macro to a lambda or vice versa,
101 ;; `cl-warnings' (calls to CL functions)
104 ;; byte-compile-compatibility Whether the compiler should
133 ;; byte-compiler has been modified to remember function definitions in
134 ;; the compilation environment in the same way that it remembers macro
143 ;; Common Lisp #. reader macro (but not in interpreted code).
196 "Emacs Lisp byte-compiler."
211 (defun byte-compiler-base-file-name (filename)
213 'byte-compiler-base-file-name)))
215 (funcall handler 'byte-compiler-base-file-name filename)
225 (setq filename (byte-compiler-base-file-name filename))
250 "*Non-nil means print messages describing progress of byte-compiler."
264 ;; "*If this is true, then the byte-compiler will generate bytecode which
269 "*Enable optimization in the byte compiler.
325 "*If true, the byte-compiler will log its optimizations into *Compile-Log*.
335 "*If true, the byte-compiler reports warnings with `error'."
341 obsolete noruntime cl-functions interactive-only)
344 "*List of warnings that the byte-compiler should issue (t for all).
351 redefine function name redefined from a macro to ordinary function or vice
356 cl-functions calls to runtime functions from the CL package (as
366 (const cl-functions) (const interactive-only))))
377 cl-functions interactive-only))
447 (defvar byte-compiler-error-flag)
449 (defconst byte-compile-initial-macro-environment
451 ;; (byte-compiler-options . (lambda (&rest forms)
452 ;; (apply 'byte-compiler-options-handler forms)))
460 "The default macro-environment passed to macroexpand by the compiler.
461 Placing a macro here will cause a macro to have different semantics when
462 expanded by the compiler as when expanded by the interpreter.")
464 (defvar byte-compile-macro-environment byte-compile-initial-macro-environment
467 \(MACRONAME . nil) when a macro is redefined as a function.")
473 \(FUNCTIONNAME . nil) when a function is redefined as a macro.
510 ;; it problematic to compile big changes to this compiler; we store the
722 ;; the byte-compiler now does source -> lapcode -> bytecode instead of
836 (equal (car xs) "cl"))
854 (when (memq 'cl-functions byte-compile-warnings)
863 (when (and (equal (car xs) "cl") (not (assoc (car xs) hist-orig)))
864 (byte-compile-find-cl-functions)))))))))
870 ;; (eval-and-compile (require 'cl) turns off warnings for cl functions.
873 (when (equal (car tem) '(require . cl))
875 (remq 'cl-functions byte-compile-warnings)))
879 ;;; byte compiler messages
941 ;; byte compiler itself; because rather than just fail looking up the
965 ;; This is used as warning-prefix for the compiler.
1057 "Issue a byte compiler warning; use (format FORMAT ARGS...) for message."
1065 (setq byte-compiler-error-flag t)
1087 ;; (defvar byte-compiler-valid-options
1099 ;; than can't be changed because the running compiler doesn't support it.
1102 ;; (setcar (cdr (cdr (assq 'new-bytecodes byte-compiler-valid-options)))
1105 ;; (setcar (cdr (cdr (assq 'file-format byte-compiler-valid-options)))
1109 ;; (defun byte-compiler-options-handler (&rest args)
1113 ;; (error "Malformed byte-compiler option `%s'" (car args)))
1116 ;; desc (assq key byte-compiler-valid-options))
1118 ;; (error "Unknown byte-compiler option `%s'" key))
1150 (defun byte-compile-fdefinition (name macro-p)
1151 (let* ((list (if macro-p
1152 byte-compile-macro-environment
1161 (and (not macro-p)
1164 (if (and (not macro-p) (byte-code-function-p fn))
1167 (if (eq 'macro (car fn))
1169 (if macro-p
1302 ;; Warn if the function or macro is being redefined with a different
1318 (if (eq (car form) 'defun) "function" "macro")
1346 (defvar byte-compile-cl-functions nil
1349 (defun byte-compile-find-cl-functions ()
1350 (unless byte-compile-cl-functions
1353 (string-match "^cl\\>" (car elt)))
1354 (setq byte-compile-cl-functions
1355 (append byte-compile-cl-functions
1357 (let ((tail byte-compile-cl-functions))
1364 (defun byte-compile-cl-warn (form)
1367 (if (and byte-compile-cl-functions
1368 (memq func byte-compile-cl-functions)
1373 '(cl-block-wrapper cl-block-throw
1375 copy-seq first second rest endp cl-member
1378 ;; or unless cl is loaded anyway.
1379 cl-defsubst-expand cl-struct-setf-expander
1383 macroexpand cl-macroexpand-all
1384 cl-compiling-file)))
1386 ;; have suitable compiler macros, but those aren't
1390 'cl-byte-compile-compiler-macro)
1392 (byte-compile-warn "Function `%s' from cl package called at runtime"
1466 (byte-compile-macro-environment
1467 ;; Copy it because the compiler may patch into the
1469 (copy-alist byte-compile-initial-macro-environment))
1476 ;; Close over these variables so that `byte-compiler-options'
1499 (byte-compile-find-cl-functions)
1713 (setq byte-compiler-error-flag nil)
1720 (if byte-compiler-error-flag
2166 ((eq form (setq form (macroexpand form byte-compile-macro-environment)))
2182 (macroexpand form byte-compile-macro-environment))
2250 ;; Detect (require 'cl) in a way that works even if cl is already loaded.
2251 (if (member (car args) '("cl" cl))
2253 (remq 'cl-functions byte-compile-warnings))))
2282 (this-kind (if macrop 'byte-compile-macro-environment
2285 'byte-compile-macro-environment))
2291 ;; When a function or macro is defined, add it to the call tree so that
2307 byte-compile-initial-macro-environment)))
2309 "`%s' defined multiple times, as both function and macro"
2315 ;; byte-compiler macros in byte-run.el...
2317 byte-compile-initial-macro-environment)))
2319 (if macrop "macro" "function")
2323 (if macrop 'lambda 'macro)))
2326 (if macrop "function" "macro")
2328 (if macrop "macro" "function")))
2342 ;; Generate code for declarations in macro definitions.
2343 ;; Remove declarations from the body of the macro definition.
2352 (prin1 `(if macro-declaration-function
2353 (funcall macro-declaration-function
2377 (if macrop '(" '(macro . #[" -1 "])") '(" #[" -1 "]")))
2380 (if macrop '(" '(macro " -1 ")") '(" '(" -1 ")")))
2381 ((if macrop '(" (cons 'macro (" -1 "))") '(" (" -1 ")"))))
2393 (if macrop '(" '(macro . #[" 4 "])") '(" #[" 4 "]")))
2396 (if macrop '(" '(macro " 2 ")") '(" '(" 2 ")")))
2397 ((if macrop '(" (cons 'macro (" 5 "))") '(" (" 5 ")"))))
2451 If FORM is a lambda or a macro, byte-compile it as a function."
2457 (macro (eq (car-safe fun) 'macro)))
2458 (if macro
2461 (setq fun (if macro
2462 (cons 'macro (byte-compile-lambda fun))
2557 ;; for symbols generated by the byte compiler itself.
2792 (setq form (macroexpand form byte-compile-macro-environment))
2814 ;; for CL compiler macros since the symbol may be
2815 ;; `cl-byte-compile-compiler-macro' but if CL isn't
2817 (or (not (memq handler '(cl-byte-compile-compiler-macro)))
2828 (if (memq 'cl-functions byte-compile-warnings)
2829 (byte-compile-cl-warn form))))
2920 (defmacro byte-defop-compiler (function &optional compile-handler)
2921 ;; add a compiler-form for FUNCTION.
2958 ;; Just like byte-defop-compiler, but defines an opcode that will only
2963 ;; #### to protect against the case where a single-version compiler
2973 (list 'byte-defop-compiler function compile-handler))))
2975 (defmacro byte-defop-compiler-1 (function &optional compile-handler)
2976 (list 'byte-defop-compiler (list function nil) compile-handler))
2992 (byte-defop-compiler point 0)
2993 ;;(byte-defop-compiler mark 0) ;; obsolete
2994 (byte-defop-compiler point-max 0)
2995 (byte-defop-compiler point-min 0)
2996 (byte-defop-compiler following-char 0)
2997 (byte-defop-compiler preceding-char 0)
2998 (byte-defop-compiler current-column 0)
2999 (byte-defop-compiler eolp 0)
3000 (byte-defop-compiler eobp 0)
3001 (byte-defop-compiler bolp 0)
3002 (byte-defop-compiler bobp 0)
3003 (byte-defop-compiler current-buffer 0)
3004 ;;(byte-defop-compiler read-char 0) ;; obsolete
3005 (byte-defop-compiler interactive-p 0)
3010 (byte-defop-compiler symbolp 1)
3011 (byte-defop-compiler consp 1)
3012 (byte-defop-compiler stringp 1)
3013 (byte-defop-compiler listp 1)
3014 (byte-defop-compiler not 1)
3015 (byte-defop-compiler (null byte-not) 1)
3016 (byte-defop-compiler car 1)
3017 (byte-defop-compiler cdr 1)
3018 (byte-defop-compiler length 1)
3019 (byte-defop-compiler symbol-value 1)
3020 (byte-defop-compiler symbol-function 1)
3021 (byte-defop-compiler (1+ byte-add1) 1)
3022 (byte-defop-compiler (1- byte-sub1) 1)
3023 (byte-defop-compiler goto-char 1)
3024 (byte-defop-compiler char-after 0-1)
3025 (byte-defop-compiler set-buffer 1)
3026 ;;(byte-defop-compiler set-mark 1) ;; obsolete
3036 (byte-defop-compiler eq 2)
3037 (byte-defop-compiler memq 2)
3038 (byte-defop-compiler cons 2)
3039 (byte-defop-compiler aref 2)
3040 (byte-defop-compiler set 2)
3041 (byte-defop-compiler (= byte-eqlsign) 2)
3042 (byte-defop-compiler (< byte-lss) 2)
3043 (byte-defop-compiler (> byte-gtr) 2)
3044 (byte-defop-compiler (<= byte-leq) 2)
3045 (byte-defop-compiler (>= byte-geq) 2)
3046 (byte-defop-compiler get 2)
3047 (byte-defop-compiler nth 2)
3048 (byte-defop-compiler substring 2-3)
3072 (byte-defop-compiler aset 3)
3074 (byte-defop-compiler max byte-compile-associative)
3075 (byte-defop-compiler min byte-compile-associative)
3076 (byte-defop-compiler (+ byte-plus) byte-compile-associative)
3080 (byte-defop-compiler-1 interactive byte-compile-noop)
3163 ;; more complicated compiler macros
3165 (byte-defop-compiler char-before)
3166 (byte-defop-compiler backward-char)
3167 (byte-defop-compiler backward-word)
3168 (byte-defop-compiler list)
3169 (byte-defop-compiler concat)
3170 (byte-defop-compiler fset)
3171 (byte-defop-compiler (indent-to-column byte-indent-to) byte-compile-indent-to)
3172 (byte-defop-compiler indent-to)
3173 (byte-defop-compiler insert)
3174 (byte-defop-compiler-1 function byte-compile-function-form)
3175 (byte-defop-compiler-1 - byte-compile-minus)
3363 (byte-defop-compiler-1 setq)
3364 (byte-defop-compiler-1 setq-default)
3365 (byte-defop-compiler-1 quote)
3366 (byte-defop-compiler-1 quote-form)
3415 (byte-defop-compiler-1 inline byte-compile-progn)
3416 (byte-defop-compiler-1 progn)
3417 (byte-defop-compiler-1 prog1)
3418 (byte-defop-compiler-1 prog2)
3419 (byte-defop-compiler-1 if)
3420 (byte-defop-compiler-1 cond)
3421 (byte-defop-compiler-1 and)
3422 (byte-defop-compiler-1 or)
3423 (byte-defop-compiler-1 while)
3424 (byte-defop-compiler-1 funcall)
3425 (byte-defop-compiler-1 apply byte-compile-funarg)
3426 (byte-defop-compiler-1 mapcar byte-compile-funarg)
3427 (byte-defop-compiler-1 mapatoms byte-compile-funarg)
3428 (byte-defop-compiler-1 mapconcat byte-compile-funarg)
3429 (byte-defop-compiler-1 mapc byte-compile-funarg)
3430 (byte-defop-compiler-1 maphash byte-compile-funarg)
3431 (byte-defop-compiler-1 map-char-table byte-compile-funarg)
3432 (byte-defop-compiler-1 sort byte-compile-funarg-2)
3433 (byte-defop-compiler-1 let)
3434 (byte-defop-compiler-1 let*)
3633 (byte-defop-compiler-1 /= byte-compile-negated)
3634 (byte-defop-compiler-1 atom byte-compile-negated)
3635 (byte-defop-compiler-1 nlistp byte-compile-negated)
3656 ;;; other tricky macro-like special-forms
3658 (byte-defop-compiler-1 catch)
3659 (byte-defop-compiler-1 unwind-protect)
3660 (byte-defop-compiler-1 condition-case)
3661 (byte-defop-compiler-1 save-excursion)
3662 (byte-defop-compiler-1 save-current-buffer)
3663 (byte-defop-compiler-1 save-restriction)
3664 (byte-defop-compiler-1 save-window-excursion)
3665 (byte-defop-compiler-1 with-output-to-temp-buffer)
3666 (byte-defop-compiler-1 track-mouse)
3760 (byte-defop-compiler-1 defun)
3761 (byte-defop-compiler-1 defmacro)
3762 (byte-defop-compiler-1 defvar)
3763 (byte-defop-compiler-1 defconst byte-compile-defvar)
3764 (byte-defop-compiler-1 autoload)
3765 (byte-defop-compiler-1 lambda byte-compile-lambda-form)
3798 (list 'cons ''macro code)
3799 (list 'quote (cons 'macro (eval code))))))
3851 (eval (nth 5 form)) ; macro-p
3854 "The compiler ignores `autoload' except at top level. You should
3855 probably put the autoload of the macro `%s' at top-level."
3901 (byte-defop-compiler-1 with-no-warnings byte-compile-no-warnings)
3907 (byte-defop-compiler-1 make-variable-buffer-local byte-compile-make-variable-buffer-local)
4063 ((eq 'macro (car f))
4066 " <compiled macro>"
4067 " <macro>"))