(provide (quote byte-compile)) (defvar byte-compile-constnum -1 "\ Transfer vector index of last constant allocated.") (defvar byte-compile-constants nil "\ Alist describing contents to put in transfer vector. Each element is (CONTENTS . INDEX)") (defvar byte-compile-macro-environment nil "\ Alist of (MACRONAME . DEFINITION) macros defined in the file which is being compiled.") (defvar byte-compile-pc 0 "\ Index in byte string to store next opcode at.") (defvar byte-compile-output nil "\ Alist describing contents to put in byte code string. Each element is (INDEX . VALUE)") (defvar byte-compile-depth 0 "\ Current depth of execution stack.") (defvar byte-compile-maxdepth 0 "\ Maximum depth of execution stack.") (defconst byte-varref 8 "\ Byte code opcode for variable reference.") (defconst byte-varset 16 "\ Byte code opcode for setting a variable.") (defconst byte-varbind 24 "\ Byte code opcode for binding a variable.") (defconst byte-call 32 "\ Byte code opcode for calling a function.") (defconst byte-unbind 40 "\ Byte code opcode for unbinding special bindings.") (defconst byte-constant 192 "\ Byte code opcode for reference to a constant.") (defconst byte-constant-limit 64 "\ Maximum index usable in byte-constant opcode.") (defconst byte-constant2 129 "\ Byte code opcode for reference to a constant with vector index >= 0100.") (defconst byte-goto 130 "\ Byte code opcode for unconditional jump") (defconst byte-goto-if-nil 131 "\ Byte code opcode for pop value and jump if it's nil.") (defconst byte-goto-if-not-nil 132 "\ Byte code opcode for pop value and jump if it's not nil.") (defconst byte-goto-if-nil-else-pop 133 "\ Byte code opcode for examine top-of-stack, jump and don't pop it if it's nil, otherwise pop it.") (defconst byte-goto-if-not-nil-else-pop 134 "\ Byte code opcode for examine top-of-stack, jump and don't pop it if it's not nil, otherwise pop it.") (defconst byte-return 135 "\ Byte code opcode for pop value and return it from byte code interpreter.") (defconst byte-discard 136 "\ Byte code opcode to discard one value from stack.") (defconst byte-dup 137 "\ Byte code opcode to duplicate the top of the stack.") (defconst byte-save-excursion 138 "\ Byte code opcode to make a binding to record the buffer, point and mark.") (defconst byte-save-window-excursion 139 "\ Byte code opcode to make a binding to record entire window configuration.") (defconst byte-save-restriction 140 "\ Byte code opcode to make a binding to record the current buffer clipping restrictions.") (defconst byte-catch 141 "\ Byte code opcode for catch. Takes, on stack, the tag and an expression for the body.") (defconst byte-unwind-protect 142 "\ Byte code opcode for unwind-protect. Takes, on stack, an expression for the body and an expression for the unwind-action.") (defconst byte-condition-case 143 "\ Byte code opcode for condition-case. Takes, on stack, the variable to bind, an expression for the body, and a list of clauses.") (defconst byte-temp-output-buffer-setup 144 "\ Byte code opcode for entry to with-output-to-temp-buffer. Takes, on stack, the buffer name. Binds standard-output and does some other things. Returns with temp buffer on the stack in place of buffer name.") (defconst byte-temp-output-buffer-show 145 "\ Byte code opcode for exit from with-output-to-temp-buffer. Expects the temp buffer on the stack underneath value to return. Pops them both, then pushes the value back on. Unbinds standard-output and makes the temp buffer visible.") (defconst byte-nth 56) (defconst byte-symbolp 57) (defconst byte-consp 58) (defconst byte-stringp 59) (defconst byte-listp 60) (defconst byte-eq 61) (defconst byte-memq 62) (defconst byte-not 63) (defconst byte-car 64) (defconst byte-cdr 65) (defconst byte-cons 66) (defconst byte-list1 67) (defconst byte-list2 68) (defconst byte-list3 69) (defconst byte-list4 70) (defconst byte-length 71) (defconst byte-aref 72) (defconst byte-aset 73) (defconst byte-symbol-value 74) (defconst byte-symbol-function 75) (defconst byte-set 76) (defconst byte-fset 77) (defconst byte-get 78) (defconst byte-substring 79) (defconst byte-concat2 80) (defconst byte-concat3 81) (defconst byte-concat4 82) (defconst byte-sub1 83) (defconst byte-add1 84) (defconst byte-eqlsign 85) (defconst byte-gtr 86) (defconst byte-lss 87) (defconst byte-leq 88) (defconst byte-geq 89) (defconst byte-diff 90) (defconst byte-negate 91) (defconst byte-plus 92) (defconst byte-max 93) (defconst byte-min 94) (defconst byte-point 96) (defconst byte-goto-char 98) (defconst byte-insert 99) (defconst byte-point-max 100) (defconst byte-point-min 101) (defconst byte-char-after 102) (defconst byte-following-char 103) (defconst byte-preceding-char 104) (defconst byte-current-column 105) (defconst byte-indent-to 106) (defconst byte-eolp 108) (defconst byte-eobp 109) (defconst byte-bolp 110) (defconst byte-bobp 111) (defconst byte-current-buffer 112) (defconst byte-set-buffer 113) (defconst byte-read-char 114) (defconst byte-interactive-p 116) (defun byte-recompile-directory (directory &optional arg) "\ Recompile every .el file in DIRECTORY that needs recompilation. This is if a .elc file exists but is older than the .el file. If the .elc file does not exist, offer to compile the .el file only if a prefix argument has been specified." (interactive "DByte recompile directory: P") (byte-code "^C ^E!%^EAE#EAA .c (defun byte-compile-file (filename) "\ Compile a file of Lisp code named FILENAME into a file of byte code. The output file's name is made by appending \"c\" to the end of FILENAME." (interactive "fByte compile file: ") (byte-code "?E!%^II\"^II!ID!AAAS q^N ^O!^Ob^ q^AO )^N ^S q^OO!^*O!.L \"^,7 q^Ob^YTAE#.' eOde!iP#)^ip!^i !)-^?" [filename inbuffer outbuffer byte-compile-macro-environment nil case-fold-search sexp emacs-lisp-mode-hook t this-line vms-stmlf-recfm expand-file-name message "Compiling %s..." get-buffer-create " *Compiler Input*" " *Compiler Output*" erase-buffer insert-file-contents 1 emacs-lisp-mode skip-chars-forward " " looking-at ";" forward-line read print byte-compile-file-form search-forward " (" "defun \\|autoload " forward-sexp 3 " " "\"" forward-char "\\ " "defvar \\|defconst " (byte-code "AA!^?" [t forward-sexp 3] 2) ((error (byte-code "?" [nil] 1))) beginning-of-line write-region file-name-sans-versions "c" kill-buffer] 32)) (defun byte-compile-file-form (form) (byte-code " (defun byte-compile-form (form) (byte-code "E \"%^E=f .j @ @D B%^ A A%^,Q (defun byte-compile-normal-call (form) (byte-code "A@!^A . AGZ%+" [form copy byte-compile-depth byte-compile-push-constant byte-compile-form byte-compile-out byte-call] 5)) (defun byte-compile-variable-ref (base-op var) (byte-code "A \"f (defun byte-compile-constant (const) (byte-code " ;f \", \"f B%^A !)+" [data const byte-compile-constants byte-compile-constnum assoc assq byte-compile-out-const] 6)) (defun byte-compile-push-constant (const) (byte-code "A!^ T%]%+" [const byte-compile-maxdepth byte-compile-depth byte-compile-constant] 4)) (put (quote point) (quote byte-compile) (quote byte-compile-no-args)) (put (quote point) (quote byte-opcode) (quote byte-point)) (put (quote dot) (quote byte-compile) (quote byte-compile-no-args)) (put (quote dot) (quote byte-opcode) (quote byte-point)) (put (quote point-max) (quote byte-compile) (quote byte-compile-no-args)) (put (quote point-max) (quote byte-opcode) (quote byte-point-max)) (put (quote point-min) (quote byte-compile) (quote byte-compile-no-args)) (put (quote point-min) (quote byte-opcode) (quote byte-point-min)) (put (quote dot-max) (quote byte-compile) (quote byte-compile-no-args)) (put (quote dot-max) (quote byte-opcode) (quote byte-point-max)) (put (quote dot-min) (quote byte-compile) (quote byte-compile-no-args)) (put (quote dot-min) (quote byte-opcode) (quote byte-point-min)) (put (quote following-char) (quote byte-compile) (quote byte-compile-no-args)) (put (quote following-char) (quote byte-opcode) (quote byte-following-char)) (put (quote preceding-char) (quote byte-compile) (quote byte-compile-no-args)) (put (quote preceding-char) (quote byte-opcode) (quote byte-preceding-char)) (put (quote current-column) (quote byte-compile) (quote byte-compile-no-args)) (put (quote current-column) (quote byte-opcode) (quote byte-current-column)) (put (quote eolp) (quote byte-compile) (quote byte-compile-no-args)) (put (quote eolp) (quote byte-opcode) (quote byte-eolp)) (put (quote eobp) (quote byte-compile) (quote byte-compile-no-args)) (put (quote eobp) (quote byte-opcode) (quote byte-eobp)) (put (quote bolp) (quote byte-compile) (quote byte-compile-no-args)) (put (quote bolp) (quote byte-opcode) (quote byte-bolp)) (put (quote bobp) (quote byte-compile) (quote byte-compile-no-args)) (put (quote bobp) (quote byte-opcode) (quote byte-bobp)) (put (quote current-buffer) (quote byte-compile) (quote byte-compile-no-args)) (put (quote current-buffer) (quote byte-opcode) (quote byte-current-buffer)) (put (quote read-char) (quote byte-compile) (quote byte-compile-no-args)) (put (quote read-char) (quote byte-opcode) (quote byte-read-char)) (put (quote symbolp) (quote byte-compile) (quote byte-compile-one-arg)) (put (quote symbolp) (quote byte-opcode) (quote byte-symbolp)) (put (quote consp) (quote byte-compile) (quote byte-compile-one-arg)) (put (quote consp) (quote byte-opcode) (quote byte-consp)) (put (quote stringp) (quote byte-compile) (quote byte-compile-one-arg)) (put (quote stringp) (quote byte-opcode) (quote byte-stringp)) (put (quote listp) (quote byte-compile) (quote byte-compile-one-arg)) (put (quote listp) (quote byte-opcode) (quote byte-listp)) (put (quote not) (quote byte-compile) (quote byte-compile-one-arg)) (put (quote not) (quote byte-opcode) (quote byte-not)) (put (quote null) (quote byte-compile) (quote byte-compile-one-arg)) (put (quote null) (quote byte-opcode) (quote byte-not)) (put (quote car) (quote byte-compile) (quote byte-compile-one-arg)) (put (quote car) (quote byte-opcode) (quote byte-car)) (put (quote cdr) (quote byte-compile) (quote byte-compile-one-arg)) (put (quote cdr) (quote byte-opcode) (quote byte-cdr)) (put (quote length) (quote byte-compile) (quote byte-compile-one-arg)) (put (quote length) (quote byte-opcode) (quote byte-length)) (put (quote symbol-value) (quote byte-compile) (quote byte-compile-one-arg)) (put (quote symbol-value) (quote byte-opcode) (quote byte-symbol-value)) (put (quote symbol-function) (quote byte-compile) (quote byte-compile-one-arg)) (put (quote symbol-function) (quote byte-opcode) (quote byte-symbol-function)) (put (quote 1+) (quote byte-compile) (quote byte-compile-one-arg)) (put (quote 1+) (quote byte-opcode) (quote byte-add1)) (put (quote 1-) (quote byte-compile) (quote byte-compile-one-arg)) (put (quote 1-) (quote byte-opcode) (quote byte-sub1)) (put (quote goto-char) (quote byte-compile) (quote byte-compile-one-arg)) (put (quote goto-char) (quote byte-opcode) (quote byte-goto-char)) (put (quote char-after) (quote byte-compile) (quote byte-compile-one-arg)) (put (quote char-after) (quote byte-opcode) (quote byte-char-after)) (put (quote set-buffer) (quote byte-compile) (quote byte-compile-one-arg)) (put (quote set-buffer) (quote byte-opcode) (quote byte-set-buffer)) (put (quote eq) (quote byte-compile) (quote byte-compile-two-args)) (put (quote eq) (quote byte-opcode) (quote byte-eq)) (put (quote eql) (quote byte-compile) (quote byte-compile-two-args)) (put (quote eql) (quote byte-opcode) (quote byte-eq)) (put (quote memq) (quote byte-compile) (quote byte-compile-two-args)) (put (quote memq) (quote byte-opcode) (quote byte-memq)) (put (quote cons) (quote byte-compile) (quote byte-compile-two-args)) (put (quote cons) (quote byte-opcode) (quote byte-cons)) (put (quote aref) (quote byte-compile) (quote byte-compile-two-args)) (put (quote aref) (quote byte-opcode) (quote byte-aref)) (put (quote set) (quote byte-compile) (quote byte-compile-two-args)) (put (quote set) (quote byte-opcode) (quote byte-set)) (put (quote fset) (quote byte-compile) (quote byte-compile-two-args)) (put (quote fset) (quote byte-opcode) (quote byte-fset)) (put (quote =) (quote byte-compile) (quote byte-compile-two-args)) (put (quote =) (quote byte-opcode) (quote byte-eqlsign)) (put (quote <) (quote byte-compile) (quote byte-compile-two-args)) (put (quote <) (quote byte-opcode) (quote byte-lss)) (put (quote >) (quote byte-compile) (quote byte-compile-two-args)) (put (quote >) (quote byte-opcode) (quote byte-gtr)) (put (quote <=) (quote byte-compile) (quote byte-compile-two-args)) (put (quote <=) (quote byte-opcode) (quote byte-leq)) (put (quote >=) (quote byte-compile) (quote byte-compile-two-args)) (put (quote >=) (quote byte-opcode) (quote byte-geq)) (put (quote get) (quote byte-compile) (quote byte-compile-two-args)) (put (quote get) (quote byte-opcode) (quote byte-get)) (put (quote nth) (quote byte-compile) (quote byte-compile-two-args)) (put (quote nth) (quote byte-opcode) (quote byte-nth)) (put (quote aset) (quote byte-compile) (quote byte-compile-three-args)) (put (quote aset) (quote byte-opcode) (quote byte-aset)) (defun byte-compile-no-args (form) (byte-code "AGA\"f (defun byte-compile-one-arg (form) (byte-code "AGA\"f (defun byte-compile-two-args (form) (byte-code "AGA\"f (defun byte-compile-three-args (form) (byte-code "AGA\"f (put (quote substring) (quote byte-compile) (quote byte-compile-substring)) (defun byte-compile-substring (form) (byte-code "GAV+ I\"+" [form byte-compile-depth byte-substring 4 2 byte-compile-normal-call byte-compile-form 1 (quote nil) 3 (quote nil) byte-compile-out 0] 7)) (put (quote interactive-p) (quote byte-compile) (quote byte-compile-interactive-p)) (defun byte-compile-interactive-p (form) (byte-code "AA\"+" [byte-interactive-p byte-compile-out 0] 3)) (put (quote list) (quote byte-compile) (quote byte-compile-list)) (defun byte-compile-list (form) (byte-code " GAUf (put (quote concat) (quote byte-compile) (quote byte-compile-concat)) (defun byte-compile-concat (form) (byte-code " GAUf .5 @!^ A%^,$ (put (quote -) (quote byte-compile) (quote byte-compile-minus)) (defun byte-compile-minus (form) (byte-code " GAUf EZ%^E E\",> AZ%^E E\",> (put (quote +) (quote byte-compile) (quote byte-compile-maybe-two-args)) (put (quote +) (quote byte-opcode) (quote byte-plus)) (put (quote max) (quote byte-compile) (quote byte-compile-maybe-two-args)) (put (quote max) (quote byte-opcode) (quote byte-max)) (put (quote min) (quote byte-compile) (quote byte-compile-maybe-two-args)) (put (quote min) (quote byte-opcode) (quote byte-min)) (defun byte-compile-maybe-two-args (form) (byte-code " GAUf& AZ%^A @CNJE\",) (put (quote function) (quote byte-compile) (quote byte-compile-function-form)) (defun byte-compile-function-form (form) (byte-code "A@9f (put (quote indent-to) (quote byte-compile) (quote byte-compile-indent-to)) (defun byte-compile-indent-to (form) (byte-code " GAUf AZ%^C E\", (put (quote insert) (quote byte-compile) (quote byte-compile-insert)) (defun byte-compile-insert (form) (byte-code " GAWf, .( @!^ CZ%^E E\"^ A%^, (put (quote setq-default) (quote byte-compile) (quote byte-compile-setq-default)) (defun byte-compile-setq-default (form) (byte-code "AAAA8DAA\"BB!+" [form byte-compile-form set-default quote 1 nthcdr 2] 6)) (put (quote quote) (quote byte-compile) (quote byte-compile-quote)) (defun byte-compile-quote (form) (byte-code "AA@!+" [form byte-compile-constant] 2)) (put (quote setq) (quote byte-compile) (quote byte-compile-setq)) (defun byte-compile-setq (form) (byte-code " Af; T]%^ S%^EE@\"^AA%^, (put (quote let) (quote byte-compile) (quote byte-compile-let)) (defun byte-compile-let (form) (byte-code " A@.# (put (quote let*) (quote byte-compile) (quote byte-compile-let*)) (defun byte-compile-let* (form) (byte-code " A@.= (put (quote save-excursion) (quote byte-compile) (quote byte-compile-save-excursion)) (defun byte-compile-save-excursion (form) (byte-code "AAA\"^AA!^AAA\"+" [form byte-compile-out byte-save-excursion 0 byte-compile-body byte-unbind 1] 5)) (put (quote save-restriction) (quote byte-compile) (quote byte-compile-save-restriction)) (defun byte-compile-save-restriction (form) (byte-code "AAA\"^AA!^AAA\"+" [form byte-compile-out byte-save-restriction 0 byte-compile-body byte-unbind 1] 5)) (put (quote with-output-to-temp-buffer) (quote byte-compile) (quote byte-compile-with-output-to-temp-buffer)) (defun byte-compile-with-output-to-temp-buffer (form) (byte-code "AA@!^AAA\"^AAA!^ACA\"^ S%+" [form byte-compile-depth byte-compile-form byte-compile-out byte-temp-output-buffer-setup 0 byte-compile-body byte-temp-output-buffer-show] 6)) (put (quote progn) (quote byte-compile) (quote byte-compile-progn)) (defun byte-compile-progn (form) (byte-code "AA!+" [form byte-compile-body] 2)) (put (quote interactive) (quote byte-compile) (quote byte-compile-noop)) (defun byte-compile-noop (form) (byte-code "AA!+" [nil byte-compile-constant] 2)) (defun byte-compile-body (body) (byte-code "?f S%^A%^, (put (quote prog1) (quote byte-compile) (quote byte-compile-prog1)) (defun byte-compile-prog1 (form) (byte-code "AA@!^AA. (put (quote prog2) (quote byte-compile) (quote byte-compile-prog2)) (defun byte-compile-prog2 (form) (byte-code "AA@!^A ^AA8!^AAA. (defun byte-compile-discard nil (byte-code "AAA\"^S%+" [byte-compile-depth byte-compile-out byte-discard 0] 3)) (put (quote if) (quote byte-compile) (quote byte-compile-if)) (defun byte-compile-if (form) (byte-code "AA\"?f- S%^CE8!^ S%^E !),b S%^CE8!^ S%^EI \"^E !^IAAA!^E !*+" [form donetag byte-compile-depth elsetag nthcdr 3 byte-compile-make-tag byte-compile-form byte-compile-goto byte-goto-if-nil-else-pop 2 byte-compile-out-tag byte-goto-if-nil byte-goto byte-compile-body] 16)) (put (quote cond) (quote byte-compile) (quote byte-compile-cond)) (defun byte-compile-cond (form) (byte-code "Af (defun byte-compile-cond-1 (clauses) (byte-code "@@A=+ \"^ S%^E@A!^I !),Y \"^ S%,* \"^I !^NA!^I !*+" [clauses t donetag byte-compile-depth elsetag car-safe quote cdr-safe byte-compile-body byte-compile-form byte-compile-make-tag byte-compile-goto byte-goto-if-nil-else-pop byte-compile-out-tag byte-goto-if-not-nil-else-pop byte-goto-if-nil byte-goto byte-compile-cond-1] 21)) (put (quote and) (quote byte-compile) (quote byte-compile-and)) (defun byte-compile-and (form) (byte-code "A A ?f (put (quote or) (quote byte-compile) (quote byte-compile-or)) (defun byte-compile-or (form) (byte-code "A A ?f (put (quote while) (quote byte-compile) (quote byte-compile-while)) (defun byte-compile-while (form) (byte-code "A A AAA !^A A@!^CE\"^E AA!^E ^CE \"^A!++" [endtag looptag args form byte-compile-make-tag byte-compile-out-tag byte-compile-form byte-compile-goto byte-goto-if-nil-else-pop byte-compile-body byte-compile-discard byte-goto] 10)) (put (quote catch) (quote byte-compile) (quote byte-compile-catch)) (defun byte-compile-catch (form) (byte-code "AA@!^AAAAAB!!^ AZ%^CEE\"+" [form byte-compile-depth byte-compile-form byte-compile-push-constant byte-compile-top-level progn 2 byte-compile-out byte-catch 0] 6)) (put (quote save-window-excursion) (quote byte-compile) (quote byte-compile-save-window-excursion)) (defun byte-compile-save-window-excursion (form) (byte-code "AAAAB!C!^ S%^AAC\"+" [form byte-compile-depth byte-compile-push-constant byte-compile-top-level progn byte-compile-out byte-save-window-excursion 0] 5)) (put (quote unwind-protect) (quote byte-compile) (quote byte-compile-unwind-protect)) (defun byte-compile-unwind-protect (form) (byte-code "AAAAAB!C!^ S%^AAC\"^EA@!^ S%^AEE\"+" [form byte-compile-depth byte-compile-push-constant byte-compile-top-level progn byte-compile-out byte-unwind-protect 0 byte-compile-form byte-unbind 1] 7)) (put (quote condition-case) (quote byte-compile) (quote byte-compile-condition-case)) (defun byte-compile-condition-case (form) (byte-code "AA@!^AAC8!!^AAAE .3 B%)^ A%^, !!*^ EZ%^III\"+" [form clauses compiled-clauses clause byte-compile-depth byte-compile-push-constant byte-compile-top-level 2 nil progn nreverse 3 byte-compile-out byte-condition-case 0] 9)) (defun byte-compile-make-tag nil (byte-code "AAB+" [nil] 2)) (defun byte-compile-out-tag (tag) (byte-code " @A \"^. \"^A%^, (defun byte-compile-goto (opcode tag) (byte-code "AA\"^A @!f @\", @B\"^ E\\%+" [opcode tag byte-compile-pc byte-compile-out 0 integerp byte-compile-store-goto setcar 2] 7)) (defun byte-compile-store-goto (at-pc to-pc) (byte-code " A A\"BB%^ TA A\"BB%+" [byte-compile-output at-pc to-pc logand 255 lsh -8] 5)) (defun byte-compile-out (opcode offset) (byte-code "A!%^ AWf (defun byte-compile-out-const (offset) (byte-code " Wf \\!, (defun byte-compile-out-1 (code) (byte-code " BB%^ T%+" [byte-compile-output byte-compile-pc code] 2)) (defun batch-byte-compile nil "\ Runs byte-compile-file on the files remaining on the command line. Must be used only with -batch, and kills emacs on completion. Each file will be processed even if an error occurred previously. For example, invoke \"emacs -batch -f batch-byte-compile $emacs/ ~/*.el\"" (byte-code "?. (defun batch-byte-compile-file (file) (byte-code "AA?+" [err (byte-code "A!^?" [file t byte-compile-file] 2) ((error (byte-code "AAf .