comparison lisp/bytecomp.el @ 284:558f606b08ae r21-0b40

Import from CVS: tag r21-0b40
author cvs
date Mon, 13 Aug 2007 10:34:13 +0200
parents 7df0dd720c89
children 70ad99077275
comparison
equal deleted inserted replaced
283:fa3d41851a08 284:558f606b08ae
30 30
31 ;;; Synched up with: FSF 19.30. 31 ;;; Synched up with: FSF 19.30.
32 32
33 ;;; Commentary: 33 ;;; Commentary:
34 34
35 ;; The Emacs Lisp byte compiler. This crunches lisp source into a sort 35 ;; The Emacs Lisp byte compiler. This crunches lisp source into a
36 ;; of p-code which takes up less space and can be interpreted faster. 36 ;; sort of p-code which takes up less space and can be interpreted
37 ;; The user entry points are byte-compile-file and byte-recompile-directory. 37 ;; faster. The user entry points are byte-compile-file,
38 ;; byte-recompile-directory and byte-compile-buffer.
38 39
39 ;;; Code: 40 ;;; Code:
40 41
41 ;;; ======================================================================== 42 ;;; ========================================================================
42 ;;; Entry points: 43 ;;; Entry points:
1564 (if load 1565 (if load
1565 (load target-file)) 1566 (load target-file))
1566 t))) 1567 t)))
1567 1568
1568 ;; RMS comments the next two out. 1569 ;; RMS comments the next two out.
1570
1571 ;;;###autoload
1569 (defun byte-compile-and-load-file (&optional filename) 1572 (defun byte-compile-and-load-file (&optional filename)
1570 "Compile a file of Lisp code named FILENAME into a file of byte code, 1573 "Compile a file of Lisp code named FILENAME into a file of byte code,
1571 and then load it. The output file's name is made by appending \"c\" to 1574 and then load it. The output file's name is made by appending \"c\" to
1572 the end of FILENAME." 1575 the end of FILENAME."
1573 (interactive) 1576 (interactive)
1574 (if filename ; I don't get it, (interactive-p) doesn't always work 1577 (if filename ; I don't get it, (interactive-p) doesn't always work
1575 (byte-compile-file filename t) 1578 (byte-compile-file filename t)
1576 (let ((current-prefix-arg '(4))) 1579 (let ((current-prefix-arg '(4)))
1577 (call-interactively 'byte-compile-file)))) 1580 (call-interactively 'byte-compile-file))))
1578 1581
1582 ;;;###autoload
1579 (defun byte-compile-buffer (&optional buffer) 1583 (defun byte-compile-buffer (&optional buffer)
1580 "Byte-compile and evaluate contents of BUFFER (default: the current buffer)." 1584 "Byte-compile and evaluate contents of BUFFER (default: the current buffer)."
1581 (interactive "bByte compile buffer: ") 1585 (interactive "bByte compile buffer: ")
1582 (setq buffer (if buffer (get-buffer buffer) (current-buffer))) 1586 (setq buffer (if buffer (get-buffer buffer) (current-buffer)))
1583 (message "Compiling %s..." (buffer-name buffer)) 1587 (message "Compiling %s..." buffer)
1584 (let* ((filename (or (buffer-file-name buffer) 1588 (let* ((filename (or (buffer-file-name buffer)
1585 (concat "#<buffer " (buffer-name buffer) ">"))) 1589 (prin1-to-string buffer)))
1586 (byte-compile-current-file buffer)) 1590 (byte-compile-current-file buffer))
1587 (byte-compile-from-buffer buffer filename t)) 1591 (byte-compile-from-buffer buffer filename t))
1588 (message "Compiling %s...done" (buffer-name buffer)) 1592 (message "Compiling %s...done" buffer)
1589 t) 1593 t)
1590 1594
1591 ;;; compiling a single function 1595 ;;; compiling a single function
1592 ;;;###autoload 1596 ;;;###autoload
1593 (defun compile-defun (&optional arg) 1597 (defun compile-defun (&optional arg)