diff options
| author | Stefan Monnier | 2004-03-22 15:22:34 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2004-03-22 15:22:34 +0000 |
| commit | 66599b54fb2fc58b536b8e3a37945762ea52bea2 (patch) | |
| tree | c87290a485b62eca870dc5d59d17fb748abe3591 | |
| parent | e856a453a1c1ce1907b3b582841bce3e9cff8cec (diff) | |
| download | emacs-66599b54fb2fc58b536b8e3a37945762ea52bea2.tar.gz emacs-66599b54fb2fc58b536b8e3a37945762ea52bea2.zip | |
(defsubst): Add edebug spec and use backquote.
(dont-compile, eval-when-compile, eval-and-compile): Add edebug spec.
| -rw-r--r-- | lisp/emacs-lisp/byte-run.el | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index a7385fe5fd0..9956d5003cc 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; byte-run.el --- byte-compiler support for inlining | 1 | ;;; byte-run.el --- byte-compiler support for inlining |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1992 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1992, 2004 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Jamie Zawinski <jwz@lucid.com> | 5 | ;; Author: Jamie Zawinski <jwz@lucid.com> |
| 6 | ;; Hallvard Furuseth <hbf@ulrik.uio.no> | 6 | ;; Hallvard Furuseth <hbf@ulrik.uio.no> |
| @@ -67,14 +67,14 @@ | |||
| 67 | ;; This has a special byte-hunk-handler in bytecomp.el. | 67 | ;; This has a special byte-hunk-handler in bytecomp.el. |
| 68 | (defmacro defsubst (name arglist &rest body) | 68 | (defmacro defsubst (name arglist &rest body) |
| 69 | "Define an inline function. The syntax is just like that of `defun'." | 69 | "Define an inline function. The syntax is just like that of `defun'." |
| 70 | (declare (debug defun)) | ||
| 70 | (or (memq (get name 'byte-optimizer) | 71 | (or (memq (get name 'byte-optimizer) |
| 71 | '(nil byte-compile-inline-expand)) | 72 | '(nil byte-compile-inline-expand)) |
| 72 | (error "`%s' is a primitive" name)) | 73 | (error "`%s' is a primitive" name)) |
| 73 | (list 'prog1 | 74 | `(prog1 |
| 74 | (cons 'defun (cons name (cons arglist body))) | 75 | (defun ,name ,arglist ,@body) |
| 75 | (list 'eval-and-compile | 76 | (eval-and-compile |
| 76 | (list 'put (list 'quote name) | 77 | (put ',name 'byte-optimizer 'byte-compile-inline-expand)))) |
| 77 | ''byte-optimizer ''byte-compile-inline-expand)))) | ||
| 78 | 78 | ||
| 79 | (defun make-obsolete (fn new &optional when) | 79 | (defun make-obsolete (fn new &optional when) |
| 80 | "Make the byte-compiler warn that FUNCTION is obsolete. | 80 | "Make the byte-compiler warn that FUNCTION is obsolete. |
| @@ -109,6 +109,7 @@ was first made obsolete, for example a date or a release number." | |||
| 109 | (defmacro dont-compile (&rest body) | 109 | (defmacro dont-compile (&rest body) |
| 110 | "Like `progn', but the body always runs interpreted (not compiled). | 110 | "Like `progn', but the body always runs interpreted (not compiled). |
| 111 | If you think you need this, you're probably making a mistake somewhere." | 111 | If you think you need this, you're probably making a mistake somewhere." |
| 112 | (declare (debug t)) | ||
| 112 | (list 'eval (list 'quote (if (cdr body) (cons 'progn body) (car body))))) | 113 | (list 'eval (list 'quote (if (cdr body) (cons 'progn body) (car body))))) |
| 113 | 114 | ||
| 114 | 115 | ||
| @@ -121,6 +122,7 @@ If you think you need this, you're probably making a mistake somewhere." | |||
| 121 | (defmacro eval-when-compile (&rest body) | 122 | (defmacro eval-when-compile (&rest body) |
| 122 | "Like `progn', but evaluates the body at compile time. | 123 | "Like `progn', but evaluates the body at compile time. |
| 123 | The result of the body appears to the compiler as a quoted constant." | 124 | The result of the body appears to the compiler as a quoted constant." |
| 125 | (declare (debug t)) | ||
| 124 | ;; Not necessary because we have it in b-c-initial-macro-environment | 126 | ;; Not necessary because we have it in b-c-initial-macro-environment |
| 125 | ;; (list 'quote (eval (cons 'progn body))) | 127 | ;; (list 'quote (eval (cons 'progn body))) |
| 126 | (cons 'progn body)) | 128 | (cons 'progn body)) |
| @@ -128,6 +130,7 @@ The result of the body appears to the compiler as a quoted constant." | |||
| 128 | (put 'eval-and-compile 'lisp-indent-hook 0) | 130 | (put 'eval-and-compile 'lisp-indent-hook 0) |
| 129 | (defmacro eval-and-compile (&rest body) | 131 | (defmacro eval-and-compile (&rest body) |
| 130 | "Like `progn', but evaluates the body at compile time and at load time." | 132 | "Like `progn', but evaluates the body at compile time and at load time." |
| 133 | (declare (debug t)) | ||
| 131 | ;; Remember, it's magic. | 134 | ;; Remember, it's magic. |
| 132 | (cons 'progn body)) | 135 | (cons 'progn body)) |
| 133 | 136 | ||