diff options
author | Miles Bader <miles@gnu.org> | 2005-03-19 02:42:17 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2005-03-19 02:42:17 +0000 |
commit | 1bac4db5629da854a984a0e84a9469f14b6b9e76 (patch) | |
tree | 068627144f173fed8c3331d541debae6c36f8988 /lisp/emacs-lisp/byte-run.el | |
parent | f603a66a19f5bfbba314daaa21e77665b3e03dd5 (diff) | |
parent | 951f97e67d904729032b476caf5f7c2e7e303d73 (diff) | |
download | emacs-1bac4db5629da854a984a0e84a9469f14b6b9e76.tar.gz emacs-1bac4db5629da854a984a0e84a9469f14b6b9e76.tar.bz2 emacs-1bac4db5629da854a984a0e84a9469f14b6b9e76.zip |
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-28
Merge from emacs--cvs-trunk--0
Patches applied:
* emacs--cvs-trunk--0 (patch 180-191)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 39-44)
- Merge from emacs--cvs-trunk--0
- Update from CVS
Diffstat (limited to 'lisp/emacs-lisp/byte-run.el')
-rw-r--r-- | lisp/emacs-lisp/byte-run.el | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index ef426494b68..60fc862676d 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -31,12 +31,36 @@ ;;; Code: +;; We define macro-declaration-function here because it is needed to +;; handle declarations in macro definitions and this is the first file +;; loaded by loadup.el that uses declarations in macros. + +(defun macro-declaration-function (macro decl) + "Process a declaration found in a macro definition. +This is set as the value of the variable `macro-declaration-function'. +MACRO is the name of the macro being defined. +DECL is a list `(declare ...)' containing the declarations. +The return value of this function is not used." + ;; We can't use `dolist' or `cadr' yet for bootstrapping reasons. + (let (d) + ;; Ignore the first element of `decl' (it's always `declare'). + (while (setq decl (cdr decl)) + (setq d (car decl)) + (cond ((and (consp d) (eq (car d) 'indent)) + (put macro 'lisp-indent-function (car (cdr d)))) + ((and (consp d) (eq (car d) 'debug)) + (put macro 'edebug-form-spec (car (cdr d)))) + (t + (message "Unknown declaration %s" d)))))) + +(setq macro-declaration-function 'macro-declaration-function) + + ;; Redefined in byte-optimize.el. ;; This is not documented--it's not clear that we should promote it. (fset 'inline 'progn) (put 'inline 'lisp-indent-function 0) - ;;; Interface to inline functions. ;; (defmacro proclaim-inline (&rest fns) @@ -105,11 +129,10 @@ was first made obsolete, for example a date or a release number." (put variable 'byte-obsolete-variable (cons new when)) variable) -(put 'dont-compile 'lisp-indent-function 0) (defmacro dont-compile (&rest body) "Like `progn', but the body always runs interpreted (not compiled). If you think you need this, you're probably making a mistake somewhere." - (declare (debug t)) + (declare (debug t) (indent 0)) (list 'eval (list 'quote (if (cdr body) (cons 'progn body) (car body))))) @@ -118,19 +141,17 @@ If you think you need this, you're probably making a mistake somewhere." ;;; definition in the file overrides the magic definitions on the ;;; byte-compile-macro-environment. -(put 'eval-when-compile 'lisp-indent-function 0) (defmacro eval-when-compile (&rest body) "Like `progn', but evaluates the body at compile time. The result of the body appears to the compiler as a quoted constant." - (declare (debug t)) + (declare (debug t) (indent 0)) ;; Not necessary because we have it in b-c-initial-macro-environment ;; (list 'quote (eval (cons 'progn body))) (cons 'progn body)) -(put 'eval-and-compile 'lisp-indent-function 0) (defmacro eval-and-compile (&rest body) "Like `progn', but evaluates the body at compile time and at load time." - (declare (debug t)) + (declare (debug t) (indent 0)) ;; Remember, it's magic. (cons 'progn body)) |