diff options
| author | Gerd Moellmann | 2002-03-24 19:48:27 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2002-03-24 19:48:27 +0000 |
| commit | 985b468607df1d1c9b703ffc3fb3f0ba91676905 (patch) | |
| tree | 6441b7a8d0bf4776511614b649c0af78fdf226b6 | |
| parent | 2c642c03dfc9b49880a673ef6946af74c7d8c99d (diff) | |
| download | emacs-985b468607df1d1c9b703ffc3fb3f0ba91676905.tar.gz emacs-985b468607df1d1c9b703ffc3fb3f0ba91676905.zip | |
(byte-compile-file-form-defmumble):
Handle declarations in macro definitions.
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 20 |
2 files changed, 26 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 252445a2bd2..9e1a9cb0158 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2002-03-24 Gerd Moellmann <gerd@gnu.org> | ||
| 2 | |||
| 3 | * subr.el (macro-declaration-function): New function. Set the | ||
| 4 | variable macro-declaration-function to it. | ||
| 5 | |||
| 6 | * emacs-lisp/bytecomp.el (byte-compile-file-form-defmumble): | ||
| 7 | Handle declarations in macro definitions. | ||
| 8 | |||
| 1 | 2002-03-24 Eli Zaretskii <eliz@is.elta.co.il> | 9 | 2002-03-24 Eli Zaretskii <eliz@is.elta.co.il> |
| 2 | 10 | ||
| 3 | * facemenu.el (facemenu-get-face): Remove unised variable | 11 | * facemenu.el (facemenu-get-face): Remove unised variable |
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 7fabdd603a8..f569a292816 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; bytecomp.el --- compilation of Lisp code into byte code | 1 | ;;; bytecomp.el --- compilation of Lisp code into byte code |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 1986, 1987, 1992, 1994, 1998, 2000, 2001 | 3 | ;; Copyright (C) 1985, 1986, 1987, 1992, 1994, 1998, 2000, 2001, 2002 |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Jamie Zawinski <jwz@lucid.com> | 6 | ;; Author: Jamie Zawinski <jwz@lucid.com> |
| @@ -10,7 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | ;;; This version incorporates changes up to version 2.10 of the | 11 | ;;; This version incorporates changes up to version 2.10 of the |
| 12 | ;;; Zawinski-Furuseth compiler. | 12 | ;;; Zawinski-Furuseth compiler. |
| 13 | (defconst byte-compile-version "$Revision: 2.94 $") | 13 | (defconst byte-compile-version "$Revision: 2.95 $") |
| 14 | 14 | ||
| 15 | ;; This file is part of GNU Emacs. | 15 | ;; This file is part of GNU Emacs. |
| 16 | 16 | ||
| @@ -1980,6 +1980,22 @@ list that represents a doc string reference. | |||
| 1980 | (stringp (car-safe (cdr-safe (cdr-safe body))))) | 1980 | (stringp (car-safe (cdr-safe (cdr-safe body))))) |
| 1981 | (byte-compile-warn "probable `\"' without `\\' in doc string of %s" | 1981 | (byte-compile-warn "probable `\"' without `\\' in doc string of %s" |
| 1982 | (nth 1 form)))) | 1982 | (nth 1 form)))) |
| 1983 | |||
| 1984 | ;; Generate code for declarations in macro definitions. | ||
| 1985 | ;; Remove declarations from the body of the macro definition. | ||
| 1986 | (when macrop | ||
| 1987 | (let ((tail (nthcdr 2 form))) | ||
| 1988 | (when (stringp (car (cdr tail))) | ||
| 1989 | (setq tail (cdr tail))) | ||
| 1990 | (while (and (consp (car (cdr tail))) | ||
| 1991 | (eq (car (car (cdr tail))) 'declare)) | ||
| 1992 | (let ((declaration (car (cdr tail)))) | ||
| 1993 | (setcdr tail (cdr (cdr tail))) | ||
| 1994 | (princ `(if macro-declaration-function | ||
| 1995 | (funcall macro-declaration-function | ||
| 1996 | ',name ',declaration)) | ||
| 1997 | outbuffer))))) | ||
| 1998 | |||
| 1983 | (let* ((new-one (byte-compile-lambda (cons 'lambda (nthcdr 2 form)))) | 1999 | (let* ((new-one (byte-compile-lambda (cons 'lambda (nthcdr 2 form)))) |
| 1984 | (code (byte-compile-byte-code-maker new-one))) | 2000 | (code (byte-compile-byte-code-maker new-one))) |
| 1985 | (if this-one | 2001 | (if this-one |